#include "mbv2.h"
#include "mbv2_para.h"
#include "stream2window.h"
#include "stream_tools.h"
#include "add.h"
#include "avgpool.h"
#include "conv.h"
#include "pwconv.h"
#include "dwconv.h"
#include "norm_actv.h"
#include "utils.h"

void mobilenet_v2(data_stream<BIT_IO>& in, axiu_stream<BIT_IO>& out)
{
	#pragma HLS INTERFACE ap_ctrl_none port=return
	#pragma HLS INTERFACE axis register both port=in
	#pragma HLS INTERFACE axis register both port=out
	#pragma HLS DATAFLOW

	data_stream<BIT_ACTV> s_input("s_input");
	reduceWidth<BIT_IO, BIT_ACTV, HIGHT1*WIDTH1*b1n1_c3_NOCH*BIT_ACTV/BIT_IO*N_BATCH>(in, s_input);
	//b2n1_c1
	data_stream<BIT_ACTV*b2n1_c1_NIN> s_b2n1_c1_in("s_b2n1_c1_in");
	expandWidth<BIT_ACTV, BIT_ACTV*b2n1_c1_NIN, HIGHT1*WIDTH1*b1n1_c3_NOCH*N_BATCH>(s_input, s_b2n1_c1_in);
	data_stream<BIT_CONV*b2n1_c1_NOUT> s_b2n1_c1_out("s_b2n1_c1_out");
	pwconv_s<b2n1_c1_NIN, b2n1_c1_NOUT, b2n1_c1_NICH, b2n1_c1_NOCH, HIGHT1*WIDTH1*N_BATCH, b2n1_c1_RAM>(s_b2n1_c1_in, s_b2n1_c1_out, b2n1_c1_W);
	data_stream<BIT_CONV*b2n1_c1_NACT> s_b2n1_c1_out_r("s_b2n1_c1_out_r");
	reduceWidth<BIT_CONV*b2n1_c1_NOUT, BIT_CONV*b2n1_c1_NACT, HIGHT1*WIDTH1*N_BATCH*b2n1_c1_NOCH/b2n1_c1_NOUT>(s_b2n1_c1_out, s_b2n1_c1_out_r);
	data_stream<BIT_ACTV*b2n1_c1_NACT> s_b2n1_c1_act("s_b2n1_c1_act");
	norm_relu<b2n1_c1_NACT, b2n1_c1_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b2n1_c1_out_r, s_b2n1_c1_act, b2n1_c1_B, b2n1_c1_M);

	//b2n1_c2
	data_stream<BIT_ACTV*b2n1_c2_NIO> s_b2n1_c2_in("s_b2n1_c2_in");
	expandWidth<BIT_ACTV*b2n1_c1_NACT, BIT_ACTV*b2n1_c2_NIO, HIGHT1*WIDTH1*b2n1_c1_NOCH/b2n1_c1_NACT*N_BATCH>(s_b2n1_c1_act, s_b2n1_c2_in);
	data_stream<BIT_ACTV*b2n1_c2_NIO> s_b2n1_c2_window("s_b2n1_c2_window");
	stream2window<BIT_ACTV*b2n1_c2_NIO, BIT_ACTV*b2n1_c2_NCH, HIGHT1, WIDTH1, N_BATCH, b2n1_c2_RAM, 2>(s_b2n1_c2_in, s_b2n1_c2_window);
	data_stream<BIT_ACTV*b2n1_c2_NIO/b2n1_c2_NG> s_b2n1_c2_window_r("s_b2n1_c2_window_r");
	reduceWidth<
		BIT_ACTV*b2n1_c2_NIO, 
		BIT_ACTV*b2n1_c2_NIO/b2n1_c2_NG, 
		HIGHT2*WIDTH2*b2n1_c1_NOCH/b2n1_c2_NIO*b2n1_c2_K*b2n1_c2_K*N_BATCH>
	(s_b2n1_c2_window, s_b2n1_c2_window_r);
	data_stream<BIT_CONV*b2n1_c2_NIO/b2n1_c2_NG> s_b2n1_c2_out("s_b2n1_c2_out");
	dwconv_3x3_r<b2n1_c2_NIO, b2n1_c2_NCH, b2n1_c2_K, b2n1_c2_NG, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c2_window_r, s_b2n1_c2_out, b2n1_c2_W);
	data_stream<BIT_CONV*b2n1_c2_NACT> s_b2n1_c2_out_r("s_b2n1_c1_out_r");
	reduceWidth<BIT_CONV*b2n1_c2_NIO/b2n1_c2_NG, BIT_CONV*b2n1_c2_NACT, HIGHT2*WIDTH2*N_BATCH*b2n1_c2_NCH/b2n1_c2_NIO*b2n1_c2_NG>(s_b2n1_c2_out, s_b2n1_c2_out_r);
	data_stream<BIT_ACTV*b2n1_c2_NACT> s_b2n1_c2_act("s_b2n1_c2_act");
	norm_relu<b2n1_c2_NACT, b2n1_c2_NCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c2_out_r, s_b2n1_c2_act, b2n1_c2_B, b2n1_c2_M);

	//b2n1_c3
	data_stream<BIT_ACTV*b2n1_c3_NIN> s_b2n1_c3_in("s_b2n1_c3_in");
	expandWidth<BIT_ACTV*b2n1_c2_NACT, BIT_ACTV*b2n1_c3_NIN, HIGHT2*WIDTH2*b2n1_c1_NOCH/b2n1_c2_NACT*N_BATCH>(s_b2n1_c2_act, s_b2n1_c3_in);
	data_stream<BIT_CONV*b2n1_c3_NOUT> s_b2n1_c3_out("s_b2n1_c3_out");
	pwconv_u<b2n1_c3_NIN, b2n1_c3_NOUT, b2n1_c3_NICH, b2n1_c3_NOCH, HIGHT2*WIDTH2*N_BATCH, b2n1_c3_RAM>(s_b2n1_c3_in, s_b2n1_c3_out, b2n1_c3_W);
	data_stream<BIT_CONV*b2n1_c3_NACT> s_b2n1_c3_out_r("s_b2n1_c3_out_r");
	reduceWidth<BIT_CONV*b2n1_c3_NOUT, BIT_CONV*b2n1_c3_NACT, HIGHT2*WIDTH2*N_BATCH*b2n1_c3_NOCH/b2n1_c3_NOUT>(s_b2n1_c3_out, s_b2n1_c3_out_r);
	data_stream<BIT_ACTV*b2n1_c3_NACT> s_b2n1_c3_act("s_b2n1_c3_act"), s_b2n1_c3_act_b1("s_b2n1_c3_act_b1"), s_b2n1_c3_act_b2("s_b2n1_c3_act_b2");
	norm<b2n1_c3_NACT, b2n1_c3_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c3_out_r, s_b2n1_c3_act, b2n1_c3_B, b2n1_c3_M);
	copy_stream<BIT_ACTV*b2n1_c3_NACT, HIGHT2*WIDTH2*b2n1_c3_NOCH/b2n1_c3_NACT*N_BATCH>(s_b2n1_c3_act, s_b2n1_c3_act_b1, s_b2n1_c3_act_b2);

	//b2n2_c1
	data_stream<BIT_ACTV*b2n2_c1_NIN> s_b2n2_c1_in("s_b2n2_c1_in");
	expandWidth<BIT_ACTV*b2n1_c3_NACT, BIT_ACTV*b2n2_c1_NIN, HIGHT2*WIDTH2*b2n1_c3_NOCH/b2n1_c3_NACT*N_BATCH>(s_b2n1_c3_act_b1, s_b2n2_c1_in);
	data_stream<BIT_CONV*b2n2_c1_NOUT> s_b2n2_c1_out("s_b2n2_c1_out");
	pwconv_s<b2n2_c1_NIN, b2n2_c1_NOUT, b2n2_c1_NICH, b2n2_c1_NOCH, HIGHT2*WIDTH2*N_BATCH, b2n2_c1_RAM>(s_b2n2_c1_in, s_b2n2_c1_out, b2n2_c1_W);
	data_stream<BIT_CONV*b2n2_c1_NACT> s_b2n2_c1_out_r("s_b2n2_c1_out_r");
	reduceWidth<BIT_CONV*b2n2_c1_NOUT, BIT_CONV*b2n2_c1_NACT, HIGHT2*WIDTH2*N_BATCH*b2n2_c1_NOCH/b2n2_c1_NOUT>(s_b2n2_c1_out, s_b2n2_c1_out_r);
	data_stream<BIT_ACTV*b2n2_c1_NACT> s_b2n2_c1_act("s_b2n2_c1_act");
	norm_relu<b2n2_c1_NACT, b2n2_c1_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c1_out_r, s_b2n2_c1_act, b2n2_c1_B, b2n2_c1_M);

	//b2n2_c2
	data_stream<BIT_ACTV*b2n2_c2_NIO> s_b2n2_c2_in("s_b2n2_c2_in");
	expandWidth<BIT_ACTV*b2n2_c1_NACT, BIT_ACTV*b2n2_c2_NIO, HIGHT2*WIDTH2*b2n2_c1_NOCH/b2n2_c2_NACT*N_BATCH>(s_b2n2_c1_act, s_b2n2_c2_in);
	data_stream<BIT_ACTV*b2n2_c2_NIO> s_b2n2_c2_window("s_b2n2_c2_window");
	stream2window<BIT_ACTV*b2n2_c2_NIO, BIT_ACTV*b2n2_c2_NCH, HIGHT2, WIDTH2, N_BATCH, b2n2_c2_RAM>(s_b2n2_c2_in, s_b2n2_c2_window);
	data_stream<BIT_CONV*b2n2_c2_NIO> s_b2n2_c2_out("s_b2n2_c2_out");
	dwconv_3x3<b2n2_c2_NIO, b2n2_c2_NCH, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c2_window, s_b2n2_c2_out, b2n2_c2_W);
	data_stream<BIT_CONV*b2n2_c2_NACT> s_b2n2_c2_out_r("s_b2n2_c2_out_r");
	reduceWidth<BIT_CONV*b2n2_c2_NIO, BIT_CONV*b2n2_c2_NACT, HIGHT2*WIDTH2*N_BATCH*b2n2_c2_NCH/b2n2_c2_NIO>(s_b2n2_c2_out, s_b2n2_c2_out_r);
	data_stream<BIT_ACTV*b2n2_c2_NACT> s_b2n2_c2_act("s_b2n2_c2_act");
	norm_relu<b2n2_c2_NACT, b2n2_c2_NCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c2_out_r, s_b2n2_c2_act, b2n2_c2_B, b2n2_c2_M);

	//b2n2_c3
	data_stream<BIT_ACTV*b2n2_c3_NIN> s_b2n2_c3_in("s_b2n2_c3_in");
	expandWidth<BIT_ACTV*b2n2_c2_NACT, BIT_ACTV*b2n2_c3_NIN, HIGHT2*WIDTH2*b2n2_c1_NOCH/b2n2_c2_NACT*N_BATCH>(s_b2n2_c2_act, s_b2n2_c3_in);
	data_stream<BIT_CONV*b2n2_c3_NOUT> s_b2n2_c3_out("s_b2n2_c3_out");
	pwconv_u<b2n2_c3_NIN, b2n2_c3_NOUT, b2n2_c3_NICH, b2n2_c3_NOCH, HIGHT2*WIDTH2*N_BATCH, b2n2_c3_RAM>(s_b2n2_c3_in, s_b2n2_c3_out, b2n2_c3_W);
	data_stream<BIT_CONV*b2n2_c3_NACT> s_b2n2_c3_out_r("s_b2n2_c3_out_r");
	reduceWidth<BIT_CONV*b2n2_c3_NOUT, BIT_CONV*b2n2_c3_NACT, HIGHT2*WIDTH2*N_BATCH*b2n2_c3_NOCH/b2n2_c3_NOUT>(s_b2n2_c3_out, s_b2n2_c3_out_r);
	data_stream<BIT_ACTV*b2n2_c3_NACT> s_b2n2_c3_act("s_b2n2_c3_act");
	norm<b2n2_c3_NACT, b2n2_c3_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c3_out_r, s_b2n2_c3_act, b2n2_c3_B, b2n2_c3_M);

	//b2n1 + b2n2
	data_stream<BIT_ACTV*b2n2_c3_NACT> s_b2n1_b2n2("s_b2n1_b2n2"), s_b2n1_b2n2_b1("s_b2n1_b2n2_b1"), s_b2n1_b2n2_b2("s_b2n1_b2n2_b2");
	add<b2n2_c3_NACT, b2n2_c3_NOCH, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c3_act_b2, s_b2n2_c3_act, s_b2n1_b2n2);

	data_stream<BIT_ACTV> s_output("s_output");
	reduceWidth<BIT_ACTV*b2n2_c3_NACT, BIT_ACTV, b2n2_c3_NOCH/b2n2_c3_NACT*HIGHT2*WIDTH2*N_BATCH>(s_b2n1_b2n2, s_output);
	add_last<BIT_ACTV, BIT_IO, b2n2_c3_NOCH*HIGHT2*WIDTH2*N_BATCH>(s_output, out);
}
/*
void mobilenet_v2(data_stream<BIT_IO>& in, axiu_stream<BIT_IO>& out)
{
	#pragma HLS INTERFACE ap_ctrl_none port=return
	#pragma HLS INTERFACE axis register both port=in
	#pragma HLS INTERFACE axis register both port=out
	#pragma HLS DATAFLOW

	data_stream<BIT_ACTV> s_input("s_input");
	reduceWidth<BIT_IO, BIT_ACTV, HIGHT0*WIDTH0*conv0_NICH*BIT_ACTV/BIT_IO*N_BATCH>(in, s_input);
	//conv0
	data_stream<BIT_ACTV*conv0_NIN> s_input_e("s_input_e");
	expandWidth<BIT_ACTV, BIT_ACTV*conv0_NIN, HIGHT0*WIDTH0*conv0_NICH*N_BATCH>(s_input, s_input_e);
	data_stream<BIT_ACTV*conv0_NIN*conv0_K> s_input_window_e("s_input_window_e");
	stream2window_ek<BIT_ACTV*conv0_NIN, BIT_ACTV*conv0_NICH, 3, HIGHT0, WIDTH0, N_BATCH, 2, 0x000000>(s_input_e, s_input_window_e);
	data_stream<BIT_CONV*conv0_NOUT> s_conv0_out("s_conv0_out");
	conv_ek<conv0_NIN, conv0_NOUT, conv0_NICH, conv0_NOCH, conv0_K, HIGHT1*WIDTH1*N_BATCH>(s_input_window_e, s_conv0_out, conv0_W);
	data_stream<BIT_CONV*conv0_NACT> s_conv0_out_r("s_conv0_out_r");
	reduceWidth<conv0_NOUT*BIT_CONV, conv0_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*conv0_NOCH/conv0_NOUT>(s_conv0_out, s_conv0_out_r);
	data_stream<BIT_ACTV*conv0_NACT> s_conv0_act("s_conv0_act");
	norm_relu<conv0_NACT, conv0_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_conv0_out_r, s_conv0_act, conv0_B, conv0_M);

	//b1n1_c1
	data_stream<BIT_ACTV*b1n1_c1_NIN> s_b1n1_c1_in("s_b1n1_c1_in");
	expandWidth<BIT_ACTV*conv0_NACT, BIT_ACTV*b1n1_c1_NIN, HIGHT1*WIDTH1*conv0_NOCH/conv0_NACT*N_BATCH>(s_conv0_act, s_b1n1_c1_in);
	data_stream<BIT_CONV*b1n1_c1_NOUT> s_b1n1_c1_out("s_b1n1_c1_out");
	pwconv_u<b1n1_c1_NIN, b1n1_c1_NOUT, b1n1_c1_NICH, b1n1_c1_NOCH, HIGHT1*WIDTH1*N_BATCH, b1n1_c1_RAM>(s_b1n1_c1_in, s_b1n1_c1_out, b1n1_c1_W);
	data_stream<BIT_CONV*b1n1_c1_NACT> s_b1n1_c1_out_r("s_b1n1_c1_out_r");
	reduceWidth<b1n1_c1_NOUT*BIT_CONV, b1n1_c1_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*b1n1_c1_NOCH/b1n1_c1_NOUT>(s_b1n1_c1_out, s_b1n1_c1_out_r);
	data_stream<BIT_ACTV*b1n1_c1_NACT> s_b1n1_c1_act("s_b1n1_c1_act");
	norm_relu<b1n1_c1_NACT, b1n1_c1_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c1_out_r, s_b1n1_c1_act, b1n1_c1_B, b1n1_c1_M);

	//b1n1_c2
	data_stream<BIT_ACTV*b1n1_c2_NIO> s_b1n1_c2_in("s_b1n1_c2_in");
	expandWidth<BIT_ACTV*b1n1_c1_NACT, BIT_ACTV*b1n1_c2_NIO, HIGHT1*WIDTH1*conv0_NOCH/conv0_NACT*N_BATCH>(s_b1n1_c1_act, s_b1n1_c2_in);
	data_stream<BIT_ACTV*b1n1_c2_NIO> s_b1n1_c1_window("s_b1n1_c1_window");
	stream2window<BIT_ACTV*b1n1_c2_NIO, BIT_ACTV*b1n1_c2_NCH, HIGHT1, WIDTH1, N_BATCH, b1n1_c2_RAM>(s_b1n1_c2_in, s_b1n1_c1_window);
	data_stream<BIT_CONV*b1n1_c2_NIO> s_b1n1_c2_out("s_b1n1_c2_out");
	dwconv_3x3<b1n1_c2_NIO, b1n1_c2_NCH, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c1_window, s_b1n1_c2_out, b1n1_c2_W);
	data_stream<BIT_CONV*b1n1_c2_NACT> s_b1n1_c2_out_r("s_b1n1_c2_out_r");
	reduceWidth<b1n1_c2_NIO*BIT_CONV, b1n1_c2_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*b1n1_c2_NCH/b1n1_c2_NIO>(s_b1n1_c2_out, s_b1n1_c2_out_r);
	data_stream<BIT_ACTV*b1n1_c2_NACT> s_b1n1_c2_act("s_b1n1_c2_act");
	norm_relu<b1n1_c2_NACT, b1n1_c2_NCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c2_out_r, s_b1n1_c2_act, b1n1_c2_B, b1n1_c2_M);

	//b1n1_c3
	data_stream<BIT_ACTV*b1n1_c3_NIN> s_b1n1_c3_in("s_b1n1_c3_in");
	expandWidth<BIT_ACTV*b1n1_c2_NACT, BIT_ACTV*b1n1_c3_NIN, HIGHT1*WIDTH1*b1n1_c2_NCH/b1n1_c2_NACT*N_BATCH>(s_b1n1_c2_act, s_b1n1_c3_in);
	data_stream<BIT_CONV*b1n1_c3_NOUT> s_b1n1_c3_out("s_b1n1_c3_out");
	pwconv_u<b1n1_c3_NIN, b1n1_c3_NOUT, b1n1_c3_NICH, b1n1_c3_NOCH, HIGHT1*WIDTH1*N_BATCH, b1n1_c3_RAM>(s_b1n1_c3_in, s_b1n1_c3_out, b1n1_c3_W);
	data_stream<BIT_CONV*b1n1_c3_NACT> s_b1n1_c3_out_r("s_b1n1_c3_out_r");
	reduceWidth<b1n1_c3_NOUT*BIT_CONV, b1n1_c3_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*b1n1_c3_NOCH/b1n1_c3_NOUT>(s_b1n1_c3_out, s_b1n1_c3_out_r);
	data_stream<BIT_ACTV*b1n1_c3_NACT> s_b1n1_c3_act("s_b1n1_c3_act");
	norm<b1n1_c3_NACT, b1n1_c3_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c3_out_r, s_b1n1_c3_act, b1n1_c3_B, b1n1_c3_M);

	data_stream<BIT_ACTV> s_output("s_output");
	reduceWidth<BIT_ACTV*b1n1_c3_NACT, BIT_ACTV, b1n1_c3_NOCH/b1n1_c3_NACT*HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c3_act, s_output);
	add_last<BIT_ACTV, BIT_IO, b1n1_c3_NOCH*HIGHT1*WIDTH1*N_BATCH>(s_output, out);
}
*/
/*
void mobilenet_v2(data_stream<BIT_IO>& in, axiu_stream<BIT_IO>& out)
{
	#pragma HLS INTERFACE ap_ctrl_none port=return
	#pragma HLS INTERFACE axis register both port=in
	#pragma HLS INTERFACE axis register both port=out
	#pragma HLS DATAFLOW

	data_stream<BIT_ACTV> s_input("s_input");
	reduceWidth<BIT_IO, BIT_ACTV, HIGHT0*WIDTH0*conv0_NICH*BIT_ACTV/BIT_IO*N_BATCH>(in, s_input);
	//conv0
	data_stream<BIT_ACTV*conv0_NIN> s_input_e("s_input_e");
	expandWidth<BIT_ACTV, BIT_ACTV*conv0_NIN, HIGHT0*WIDTH0*conv0_NICH*N_BATCH>(s_input, s_input_e);
	data_stream<BIT_ACTV*conv0_NIN*conv0_K> s_input_window_e("s_input_window_e");
	stream2window_ek<BIT_ACTV*conv0_NIN, BIT_ACTV*conv0_NICH, 3, HIGHT0, WIDTH0, N_BATCH, 2, 0x000000>(s_input_e, s_input_window_e);
	data_stream<BIT_CONV*conv0_NOUT> s_conv0_out("s_conv0_out");
	conv_ek<conv0_NIN, conv0_NOUT, conv0_NICH, conv0_NOCH, conv0_K, HIGHT1*WIDTH1*N_BATCH>(s_input_window_e, s_conv0_out, conv0_W);
	data_stream<BIT_CONV*conv0_NACT> s_conv0_out_r("s_conv0_out_r");
	reduceWidth<conv0_NOUT*BIT_CONV, conv0_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*conv0_NOCH/conv0_NOUT>(s_conv0_out, s_conv0_out_r);
	data_stream<BIT_ACTV*conv0_NACT> s_conv0_act("s_conv0_act");
	norm_relu<conv0_NACT, conv0_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_conv0_out_r, s_conv0_act, conv0_B, conv0_M);

	//b1n1_c1
	data_stream<BIT_ACTV*b1n1_c1_NIN> s_b1n1_c1_in("s_b1n1_c1_in");
	expandWidth<BIT_ACTV*conv0_NACT, BIT_ACTV*b1n1_c1_NIN, HIGHT1*WIDTH1*conv0_NOCH/conv0_NACT*N_BATCH>(s_conv0_act, s_b1n1_c1_in);
	data_stream<BIT_CONV*b1n1_c1_NOUT> s_b1n1_c1_out("s_b1n1_c1_out");
	pwconv_u<b1n1_c1_NIN, b1n1_c1_NOUT, b1n1_c1_NICH, b1n1_c1_NOCH, HIGHT1*WIDTH1*N_BATCH, b1n1_c1_RAM>(s_b1n1_c1_in, s_b1n1_c1_out, b1n1_c1_W);
	data_stream<BIT_CONV*b1n1_c1_NACT> s_b1n1_c1_out_r("s_b1n1_c1_out_r");
	reduceWidth<b1n1_c1_NOUT*BIT_CONV, b1n1_c1_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*b1n1_c1_NOCH/b1n1_c1_NOUT>(s_b1n1_c1_out, s_b1n1_c1_out_r);
	data_stream<BIT_ACTV*b1n1_c1_NACT> s_b1n1_c1_act("s_b1n1_c1_act");
	norm_relu<b1n1_c1_NACT, b1n1_c1_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c1_out_r, s_b1n1_c1_act, b1n1_c1_B, b1n1_c1_M);

	//b1n1_c2
	data_stream<BIT_ACTV*b1n1_c2_NIO> s_b1n1_c2_in("s_b1n1_c2_in");
	expandWidth<BIT_ACTV*b1n1_c1_NACT, BIT_ACTV*b1n1_c2_NIO, HIGHT1*WIDTH1*conv0_NOCH/conv0_NACT*N_BATCH>(s_b1n1_c1_act, s_b1n1_c2_in);
	data_stream<BIT_ACTV*b1n1_c2_NIO> s_b1n1_c1_window("s_b1n1_c1_window");
	stream2window<BIT_ACTV*b1n1_c2_NIO, BIT_ACTV*b1n1_c2_NCH, HIGHT1, WIDTH1, N_BATCH, b1n1_c2_RAM>(s_b1n1_c2_in, s_b1n1_c1_window);
	data_stream<BIT_CONV*b1n1_c2_NIO> s_b1n1_c2_out("s_b1n1_c2_out");
	dwconv_3x3<b1n1_c2_NIO, b1n1_c2_NCH, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c1_window, s_b1n1_c2_out, b1n1_c2_W);
	data_stream<BIT_CONV*b1n1_c2_NACT> s_b1n1_c2_out_r("s_b1n1_c2_out_r");
	reduceWidth<b1n1_c2_NIO*BIT_CONV, b1n1_c2_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*b1n1_c2_NCH/b1n1_c2_NIO>(s_b1n1_c2_out, s_b1n1_c2_out_r);
	data_stream<BIT_ACTV*b1n1_c2_NACT> s_b1n1_c2_act("s_b1n1_c2_act");
	norm_relu<b1n1_c2_NACT, b1n1_c2_NCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c2_out_r, s_b1n1_c2_act, b1n1_c2_B, b1n1_c2_M);

	//b1n1_c3
	data_stream<BIT_ACTV*b1n1_c3_NIN> s_b1n1_c3_in("s_b1n1_c3_in");
	expandWidth<BIT_ACTV*b1n1_c2_NACT, BIT_ACTV*b1n1_c3_NIN, HIGHT1*WIDTH1*b1n1_c2_NCH/b1n1_c2_NACT*N_BATCH>(s_b1n1_c2_act, s_b1n1_c3_in);
	data_stream<BIT_CONV*b1n1_c3_NOUT> s_b1n1_c3_out("s_b1n1_c3_out");
	pwconv_u<b1n1_c3_NIN, b1n1_c3_NOUT, b1n1_c3_NICH, b1n1_c3_NOCH, HIGHT1*WIDTH1*N_BATCH, b1n1_c3_RAM>(s_b1n1_c3_in, s_b1n1_c3_out, b1n1_c3_W);
	data_stream<BIT_CONV*b1n1_c3_NACT> s_b1n1_c3_out_r("s_b1n1_c3_out_r");
	reduceWidth<b1n1_c3_NOUT*BIT_CONV, b1n1_c3_NACT*BIT_CONV, HIGHT1*WIDTH1*N_BATCH*b1n1_c3_NOCH/b1n1_c3_NOUT>(s_b1n1_c3_out, s_b1n1_c3_out_r);
	data_stream<BIT_ACTV*b1n1_c3_NACT> s_b1n1_c3_act("s_b1n1_c3_act");
	norm<b1n1_c3_NACT, b1n1_c3_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b1n1_c3_out_r, s_b1n1_c3_act, b1n1_c3_B, b1n1_c3_M);

	//b2n1_c1
	data_stream<BIT_ACTV*b2n1_c1_NIN> s_b2n1_c1_in("s_b2n1_c1_in");
	expandWidth<BIT_ACTV*b1n1_c3_NACT, BIT_ACTV*b2n1_c1_NIN, HIGHT1*WIDTH1*b1n1_c3_NOCH/b1n1_c3_NACT*N_BATCH>(s_b1n1_c3_act, s_b2n1_c1_in);
	data_stream<BIT_CONV*b2n1_c1_NOUT> s_b2n1_c1_out("s_b2n1_c1_out");
	pwconv_s<b2n1_c1_NIN, b2n1_c1_NOUT, b2n1_c1_NICH, b2n1_c1_NOCH, HIGHT1*WIDTH1*N_BATCH, b2n1_c1_RAM>(s_b2n1_c1_in, s_b2n1_c1_out, b2n1_c1_W);
	data_stream<BIT_CONV*b2n1_c1_NACT> s_b2n1_c1_out_r("s_b2n1_c1_out_r");
	reduceWidth<BIT_CONV*b2n1_c1_NOUT, BIT_CONV*b2n1_c1_NACT, HIGHT1*WIDTH1*N_BATCH*b2n1_c1_NOCH/b2n1_c1_NOUT>(s_b2n1_c1_out, s_b2n1_c1_out_r);
	data_stream<BIT_ACTV*b2n1_c1_NACT> s_b2n1_c1_act("s_b2n1_c1_act");
	norm_relu<b2n1_c1_NACT, b2n1_c1_NOCH, BIT_MULT-1, HIGHT1*WIDTH1*N_BATCH>(s_b2n1_c1_out_r, s_b2n1_c1_act, b2n1_c1_B, b2n1_c1_M);

	//b2n1_c2
	data_stream<BIT_ACTV*b2n1_c2_NIO> s_b2n1_c2_in("s_b2n1_c2_in");
	expandWidth<BIT_ACTV*b2n1_c1_NACT, BIT_ACTV*b2n1_c2_NIO, HIGHT1*WIDTH1*b2n1_c1_NOCH/b2n1_c1_NACT*N_BATCH>(s_b2n1_c1_act, s_b2n1_c2_in);
	data_stream<BIT_ACTV*b2n1_c2_NIO> s_b2n1_c2_window("s_b2n1_c2_window");
	stream2window<BIT_ACTV*b2n1_c2_NIO, BIT_ACTV*b2n1_c2_NCH, HIGHT1, WIDTH1, N_BATCH, b2n1_c2_RAM, 2>(s_b2n1_c2_in, s_b2n1_c2_window);
	data_stream<BIT_ACTV*b2n1_c2_NIO/b2n1_c2_NG> s_b2n1_c2_window_r("s_b2n1_c2_window_r");
	reduceWidth<
		BIT_ACTV*b2n1_c2_NIO, 
		BIT_ACTV*b2n1_c2_NIO/b2n1_c2_NG, 
		HIGHT2*WIDTH2*b2n1_c1_NOCH/b2n1_c2_NIO*b2n1_c2_K*b2n1_c2_K*N_BATCH>
	(s_b2n1_c2_window, s_b2n1_c2_window_r);
	data_stream<BIT_CONV*b2n1_c2_NIO/b2n1_c2_NG> s_b2n1_c2_out("s_b2n1_c2_out");
	dwconv_3x3_r<b2n1_c2_NIO, b2n1_c2_NCH, b2n1_c2_K, b2n1_c2_NG, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c2_window_r, s_b2n1_c2_out, b2n1_c2_W);
	data_stream<BIT_CONV*b2n1_c2_NACT> s_b2n1_c2_out_r("s_b2n1_c1_out_r");
	reduceWidth<BIT_CONV*b2n1_c2_NIO/b2n1_c2_NG, BIT_CONV*b2n1_c2_NACT, HIGHT2*WIDTH2*N_BATCH*b2n1_c2_NCH/b2n1_c2_NIO*b2n1_c2_NG>(s_b2n1_c2_out, s_b2n1_c2_out_r);
	data_stream<BIT_ACTV*b2n1_c2_NACT> s_b2n1_c2_act("s_b2n1_c2_act");
	norm_relu<b2n1_c2_NACT, b2n1_c2_NCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c2_out_r, s_b2n1_c2_act, b2n1_c2_B, b2n1_c2_M);

	//b2n1_c3
	data_stream<BIT_ACTV*b2n1_c3_NIN> s_b2n1_c3_in("s_b2n1_c3_in");
	expandWidth<BIT_ACTV*b2n1_c2_NACT, BIT_ACTV*b2n1_c3_NIN, HIGHT2*WIDTH2*b2n1_c1_NOCH/b2n1_c2_NACT*N_BATCH>(s_b2n1_c2_act, s_b2n1_c3_in);
	data_stream<BIT_CONV*b2n1_c3_NOUT> s_b2n1_c3_out("s_b2n1_c3_out");
	pwconv_u<b2n1_c3_NIN, b2n1_c3_NOUT, b2n1_c3_NICH, b2n1_c3_NOCH, HIGHT2*WIDTH2*N_BATCH, b2n1_c3_RAM>(s_b2n1_c3_in, s_b2n1_c3_out, b2n1_c3_W);
	data_stream<BIT_CONV*b2n1_c3_NACT> s_b2n1_c3_out_r("s_b2n1_c3_out_r");
	reduceWidth<BIT_CONV*b2n1_c3_NOUT, BIT_CONV*b2n1_c3_NACT, HIGHT2*WIDTH2*N_BATCH*b2n1_c3_NOCH/b2n1_c3_NOUT>(s_b2n1_c3_out, s_b2n1_c3_out_r);
	data_stream<BIT_ACTV*b2n1_c3_NACT> s_b2n1_c3_act("s_b2n1_c3_act"), s_b2n1_c3_act_b1("s_b2n1_c3_act_b1"), s_b2n1_c3_act_b2("s_b2n1_c3_act_b2");
	norm<b2n1_c3_NACT, b2n1_c3_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c3_out_r, s_b2n1_c3_act, b2n1_c3_B, b2n1_c3_M);
	copy_stream<BIT_ACTV*b2n1_c3_NACT, HIGHT2*WIDTH2*b2n1_c3_NOCH/b2n1_c3_NACT*N_BATCH>(s_b2n1_c3_act, s_b2n1_c3_act_b1, s_b2n1_c3_act_b2);

	//b2n2_c1
	data_stream<BIT_ACTV*b2n2_c1_NIN> s_b2n2_c1_in("s_b2n2_c1_in");
	expandWidth<BIT_ACTV*b2n1_c3_NACT, BIT_ACTV*b2n2_c1_NIN, HIGHT2*WIDTH2*b2n1_c3_NOCH/b2n1_c3_NACT*N_BATCH>(s_b2n1_c3_act_b1, s_b2n2_c1_in);
	data_stream<BIT_CONV*b2n2_c1_NOUT> s_b2n2_c1_out("s_b2n2_c1_out");
	pwconv_s<b2n2_c1_NIN, b2n2_c1_NOUT, b2n2_c1_NICH, b2n2_c1_NOCH, HIGHT2*WIDTH2*N_BATCH, b2n2_c1_RAM>(s_b2n2_c1_in, s_b2n2_c1_out, b2n2_c1_W);
	data_stream<BIT_CONV*b2n2_c1_NACT> s_b2n2_c1_out_r("s_b2n2_c1_out_r");
	reduceWidth<BIT_CONV*b2n2_c1_NOUT, BIT_CONV*b2n2_c1_NACT, HIGHT2*WIDTH2*N_BATCH*b2n2_c1_NOCH/b2n2_c1_NOUT>(s_b2n2_c1_out, s_b2n2_c1_out_r);
	data_stream<BIT_ACTV*b2n2_c1_NACT> s_b2n2_c1_act("s_b2n2_c1_act");
	norm_relu<b2n2_c1_NACT, b2n2_c1_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c1_out_r, s_b2n2_c1_act, b2n2_c1_B, b2n2_c1_M);

	//b2n2_c2
	data_stream<BIT_ACTV*b2n2_c2_NIO> s_b2n2_c2_in("s_b2n2_c2_in");
	expandWidth<BIT_ACTV*b2n2_c1_NACT, BIT_ACTV*b2n2_c2_NIO, HIGHT2*WIDTH2*b2n2_c1_NOCH/b2n2_c2_NACT*N_BATCH>(s_b2n2_c1_act, s_b2n2_c2_in);
	data_stream<BIT_ACTV*b2n2_c2_NIO> s_b2n2_c2_window("s_b2n2_c2_window");
	stream2window<BIT_ACTV*b2n2_c2_NIO, BIT_ACTV*b2n2_c2_NCH, HIGHT2, WIDTH2, N_BATCH, b2n2_c2_RAM>(s_b2n2_c2_in, s_b2n2_c2_window);
	data_stream<BIT_CONV*b2n2_c2_NIO> s_b2n2_c2_out("s_b2n2_c2_out");
	dwconv_3x3<b2n2_c2_NIO, b2n2_c2_NCH, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c2_window, s_b2n2_c2_out, b2n2_c2_W);
	data_stream<BIT_CONV*b2n2_c2_NACT> s_b2n2_c2_out_r("s_b2n2_c2_out_r");
	reduceWidth<BIT_CONV*b2n2_c2_NIO, BIT_CONV*b2n2_c2_NACT, HIGHT2*WIDTH2*N_BATCH*b2n2_c2_NCH/b2n2_c2_NIO>(s_b2n2_c2_out, s_b2n2_c2_out_r);
	data_stream<BIT_ACTV*b2n2_c2_NACT> s_b2n2_c2_act("s_b2n2_c2_act");
	norm_relu<b2n2_c2_NACT, b2n2_c2_NCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c2_out_r, s_b2n2_c2_act, b2n2_c2_B, b2n2_c2_M);

	//b2n2_c3
	data_stream<BIT_ACTV*b2n2_c3_NIN> s_b2n2_c3_in("s_b2n2_c3_in");
	expandWidth<BIT_ACTV*b2n2_c2_NACT, BIT_ACTV*b2n2_c3_NIN, HIGHT2*WIDTH2*b2n2_c1_NOCH/b2n2_c2_NACT*N_BATCH>(s_b2n2_c2_act, s_b2n2_c3_in);
	data_stream<BIT_CONV*b2n2_c3_NOUT> s_b2n2_c3_out("s_b2n2_c3_out");
	pwconv_u<b2n2_c3_NIN, b2n2_c3_NOUT, b2n2_c3_NICH, b2n2_c3_NOCH, HIGHT2*WIDTH2*N_BATCH, b2n2_c3_RAM>(s_b2n2_c3_in, s_b2n2_c3_out, b2n2_c3_W);
	data_stream<BIT_CONV*b2n2_c3_NACT> s_b2n2_c3_out_r("s_b2n2_c3_out_r");
	reduceWidth<BIT_CONV*b2n2_c3_NOUT, BIT_CONV*b2n2_c3_NACT, HIGHT2*WIDTH2*N_BATCH*b2n2_c3_NOCH/b2n2_c3_NOUT>(s_b2n2_c3_out, s_b2n2_c3_out_r);
	data_stream<BIT_ACTV*b2n2_c3_NACT> s_b2n2_c3_act("s_b2n2_c3_act");
	norm<b2n2_c3_NACT, b2n2_c3_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b2n2_c3_out_r, s_b2n2_c3_act, b2n2_c3_B, b2n2_c3_M);

	//b2n1 + b2n2
	data_stream<BIT_ACTV*b2n2_c3_NACT> s_b2n1_b2n2("s_b2n1_b2n2"), s_b2n1_b2n2_b1("s_b2n1_b2n2_b1"), s_b2n1_b2n2_b2("s_b2n1_b2n2_b2");
	add<b2n2_c3_NACT, b2n2_c3_NOCH, HIGHT2*WIDTH2*N_BATCH>(s_b2n1_c3_act_b2, s_b2n2_c3_act, s_b2n1_b2n2);

	//b3n1_c1
	data_stream<BIT_ACTV*b3n1_c1_NIN> s_b3n1_c1_in("s_b3n1_c1_in");
	expandWidth<BIT_ACTV*b2n2_c3_NACT, BIT_ACTV*b3n1_c1_NIN, HIGHT2*WIDTH2*b2n2_c3_NOCH/b2n2_c3_NACT*N_BATCH>(s_b2n1_b2n2, s_b3n1_c1_in);
	data_stream<BIT_CONV*b3n1_c1_NOUT> s_b3n1_c1_out("s_b3n1_c1_out");
	pwconv_s<b3n1_c1_NIN, b3n1_c1_NOUT, b3n1_c1_NICH, b3n1_c1_NOCH, HIGHT2*WIDTH2*N_BATCH, b3n1_c1_RAM>(s_b3n1_c1_in, s_b3n1_c1_out, b3n1_c1_W);
	data_stream<BIT_CONV*b3n1_c1_NACT> s_b3n1_c1_out_r("s_b3n1_c1_out_r");
	reduceWidth<BIT_CONV*b3n1_c1_NOUT, BIT_CONV*b3n1_c1_NACT, HIGHT2*WIDTH2*N_BATCH*b3n1_c1_NOCH/b3n1_c1_NOUT>(s_b3n1_c1_out, s_b3n1_c1_out_r);
	data_stream<BIT_ACTV*b3n1_c1_NACT> s_b3n1_c1_act("s_b3n1_c1_act");
	norm_relu<b3n1_c1_NACT, b3n1_c1_NOCH, BIT_MULT-1, HIGHT2*WIDTH2*N_BATCH>(s_b3n1_c1_out_r, s_b3n1_c1_act, b3n1_c1_B, b3n1_c1_M);

	//b3n1_c2
	data_stream<BIT_ACTV*b3n1_c2_NIO> s_b3n1_c2_in("s_b3n1_c2_in");
	expandWidth<BIT_ACTV*b3n1_c1_NACT, BIT_ACTV*b3n1_c2_NIO, HIGHT2*WIDTH2*b3n1_c1_NOCH/b3n1_c1_NACT*N_BATCH>(s_b3n1_c1_act, s_b3n1_c2_in);
	data_stream<BIT_ACTV*b3n1_c2_NIO> s_b3n1_c2_window("s_b3n1_c2_window");
	stream2window<BIT_ACTV*b3n1_c2_NIO, BIT_ACTV*b3n1_c2_NCH, HIGHT2, WIDTH2, N_BATCH, b3n1_c2_RAM, 2>(s_b3n1_c2_in, s_b3n1_c2_window);
	data_stream<BIT_ACTV*b3n1_c2_NIO/b3n1_c2_NG> s_b3n1_c2_window_r("s_b3n1_c2_window_r");
	reduceWidth<
		BIT_ACTV*b3n1_c2_NIO, 
		BIT_ACTV*b3n1_c2_NIO/b3n1_c2_NG, 
		HIGHT3*WIDTH3*b3n1_c1_NOCH/b3n1_c2_NIO*b3n1_c2_K*b3n1_c2_K*N_BATCH>
	(s_b3n1_c2_window, s_b3n1_c2_window_r);
	data_stream<BIT_CONV*b3n1_c2_NIO/b3n1_c2_NG> s_b3n1_c2_out("s_b3n1_c2_out");
	dwconv_3x3_r<b3n1_c2_NIO, b3n1_c2_NCH, b3n1_c2_K, b3n1_c2_NG, HIGHT3*WIDTH3*N_BATCH>(s_b3n1_c2_window_r, s_b3n1_c2_out, b3n1_c2_W);
	data_stream<BIT_CONV*b3n1_c2_NACT> s_b3n1_c2_out_r("s_b3n1_c1_out_r");
	reduceWidth<BIT_CONV*b3n1_c2_NIO/b3n1_c2_NG, BIT_CONV*b3n1_c2_NACT, HIGHT3*WIDTH3*N_BATCH*b3n1_c2_NCH/b3n1_c2_NIO*b3n1_c2_NG>(s_b3n1_c2_out, s_b3n1_c2_out_r);
	data_stream<BIT_ACTV*b3n1_c2_NACT> s_b3n1_c2_act("s_b3n1_c2_act");
	norm_relu<b3n1_c2_NACT, b3n1_c2_NCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n1_c2_out_r, s_b3n1_c2_act, b3n1_c2_B, b3n1_c2_M);

	//b3n1_c3
	data_stream<BIT_ACTV*b3n1_c3_NIN> s_b3n1_c3_in("s_b3n1_c3_in");
	expandWidth<BIT_ACTV*b3n1_c2_NACT, BIT_ACTV*b3n1_c3_NIN, HIGHT3*WIDTH3*b3n1_c1_NOCH/b3n1_c2_NACT*N_BATCH>(s_b3n1_c2_act, s_b3n1_c3_in);
	data_stream<BIT_CONV*b3n1_c3_NOUT> s_b3n1_c3_out("s_b3n1_c3_out");
	pwconv_u<b3n1_c3_NIN, b3n1_c3_NOUT, b3n1_c3_NICH, b3n1_c3_NOCH, HIGHT3*WIDTH3*N_BATCH, b3n1_c3_RAM>(s_b3n1_c3_in, s_b3n1_c3_out, b3n1_c3_W);
	data_stream<BIT_CONV*b3n1_c3_NACT> s_b3n1_c3_out_r("s_b3n1_c3_out_r");
	reduceWidth<BIT_CONV*b3n1_c3_NOUT, BIT_CONV*b3n1_c3_NACT, HIGHT3*WIDTH3*N_BATCH*b3n1_c3_NOCH/b3n1_c3_NOUT>(s_b3n1_c3_out, s_b3n1_c3_out_r);
	data_stream<BIT_ACTV*b3n1_c3_NACT> s_b3n1_c3_act("s_b3n1_c3_act"), s_b3n1_c3_act_b1("s_b3n1_c3_act_b1"), s_b3n1_c3_act_b2("s_b3n1_c3_act_b2");
	norm<b3n1_c3_NACT, b3n1_c3_NOCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n1_c3_out_r, s_b3n1_c3_act, b3n1_c3_B, b3n1_c3_M);
	copy_stream<BIT_ACTV*b3n1_c3_NACT, HIGHT3*WIDTH3*b3n1_c3_NOCH/b3n1_c3_NACT*N_BATCH>(s_b3n1_c3_act, s_b3n1_c3_act_b1, s_b3n1_c3_act_b2);

	//b3n2_c1
	data_stream<BIT_ACTV*b3n2_c1_NIN> s_b3n2_c1_in("s_b3n2_c1_in");
	expandWidth<BIT_ACTV*b3n1_c3_NACT, BIT_ACTV*b3n2_c1_NIN, HIGHT3*WIDTH3*b3n1_c3_NOCH/b3n1_c3_NACT*N_BATCH>(s_b3n1_c3_act_b1, s_b3n2_c1_in);
	data_stream<BIT_CONV*b3n2_c1_NOUT> s_b3n2_c1_out("s_b3n2_c1_out");
	pwconv_s<b3n2_c1_NIN, b3n2_c1_NOUT, b3n2_c1_NICH, b3n2_c1_NOCH, HIGHT3*WIDTH3*N_BATCH, b3n2_c1_RAM>(s_b3n2_c1_in, s_b3n2_c1_out, b3n2_c1_W);
	data_stream<BIT_CONV*b3n2_c1_NACT> s_b3n2_c1_out_r("s_b3n2_c1_out_r");
	reduceWidth<BIT_CONV*b3n2_c1_NOUT, BIT_CONV*b3n2_c1_NACT, HIGHT3*WIDTH3*N_BATCH*b3n2_c1_NOCH/b3n2_c1_NOUT>(s_b3n2_c1_out, s_b3n2_c1_out_r);
	data_stream<BIT_ACTV*b3n2_c1_NACT> s_b3n2_c1_act("s_b3n2_c1_act");
	norm_relu<b3n2_c1_NACT, b3n2_c1_NOCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n2_c1_out_r, s_b3n2_c1_act, b3n2_c1_B, b3n2_c1_M);

	//b3n2_c2
	data_stream<BIT_ACTV*b3n2_c2_NIO> s_b3n2_c2_in("s_b3n2_c2_in");
	expandWidth<BIT_ACTV*b3n2_c1_NACT, BIT_ACTV*b3n2_c2_NIO, HIGHT3*WIDTH3*b3n2_c1_NOCH/b3n2_c2_NACT*N_BATCH>(s_b3n2_c1_act, s_b3n2_c2_in);
	data_stream<BIT_ACTV*b3n2_c2_NIO> s_b3n2_c2_window("s_b3n2_c2_window");
	stream2window<BIT_ACTV*b3n2_c2_NIO, BIT_ACTV*b3n2_c2_NCH, HIGHT3, WIDTH3, N_BATCH, b3n2_c2_RAM>(s_b3n2_c2_in, s_b3n2_c2_window);
	data_stream<BIT_CONV*b3n2_c2_NIO> s_b3n2_c2_out("s_b3n2_c2_out");
	dwconv_3x3<b3n2_c2_NIO, b3n2_c2_NCH, HIGHT3*WIDTH3*N_BATCH>(s_b3n2_c2_window, s_b3n2_c2_out, b3n2_c2_W);
	data_stream<BIT_CONV*b3n2_c2_NACT> s_b3n2_c2_out_r("s_b3n2_c2_out_r");
	reduceWidth<BIT_CONV*b3n2_c2_NIO, BIT_CONV*b3n2_c2_NACT, HIGHT3*WIDTH3*N_BATCH*b3n2_c2_NCH/b3n2_c2_NIO>(s_b3n2_c2_out, s_b3n2_c2_out_r);
	data_stream<BIT_ACTV*b3n2_c2_NACT> s_b3n2_c2_act("s_b3n2_c2_act");
	norm_relu<b3n2_c2_NACT, b3n2_c2_NCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n2_c2_out_r, s_b3n2_c2_act, b3n2_c2_B, b3n2_c2_M);

	//b3n2_c3
	data_stream<BIT_ACTV*b3n2_c3_NIN> s_b3n2_c3_in("s_b3n2_c3_in");
	expandWidth<BIT_ACTV*b3n2_c2_NACT, BIT_ACTV*b3n2_c3_NIN, HIGHT3*WIDTH3*b3n2_c1_NOCH/b3n2_c2_NACT*N_BATCH>(s_b3n2_c2_act, s_b3n2_c3_in);
	data_stream<BIT_CONV*b3n2_c3_NOUT> s_b3n2_c3_out("s_b3n2_c3_out");
	pwconv_u<b3n2_c3_NIN, b3n2_c3_NOUT, b3n2_c3_NICH, b3n2_c3_NOCH, HIGHT3*WIDTH3*N_BATCH, b3n2_c3_RAM>(s_b3n2_c3_in, s_b3n2_c3_out, b3n2_c3_W);
	data_stream<BIT_CONV*b3n2_c3_NACT> s_b3n2_c3_out_r("s_b3n2_c3_out_r");
	reduceWidth<BIT_CONV*b3n2_c3_NOUT, BIT_CONV*b3n2_c3_NACT, HIGHT3*WIDTH3*N_BATCH*b3n2_c3_NOCH/b3n2_c3_NOUT>(s_b3n2_c3_out, s_b3n2_c3_out_r);
	data_stream<BIT_ACTV*b3n2_c3_NACT> s_b3n2_c3_act("s_b3n2_c3_act");
	norm<b3n2_c3_NACT, b3n2_c3_NOCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n2_c3_out_r, s_b3n2_c3_act, b3n2_c3_B, b3n2_c3_M);

	//b3n1 + b3n2
	data_stream<BIT_ACTV*b3n2_c3_NACT> s_b3n1_b3n2("s_b3n1_b3n2"), s_b3n1_b3n2_b1("s_b3n1_b3n2_b1"), s_b3n1_b3n2_b2("s_b3n1_b3n2_b2");
	add<b3n2_c3_NACT, b3n2_c3_NOCH, HIGHT3*WIDTH3*N_BATCH>(s_b3n1_c3_act_b2, s_b3n2_c3_act, s_b3n1_b3n2);
	copy_stream<BIT_ACTV*b3n1_c3_NACT, HIGHT3*WIDTH3*b3n1_c3_NOCH/b3n1_c3_NACT*N_BATCH>(s_b3n1_b3n2, s_b3n1_b3n2_b1, s_b3n1_b3n2_b2);

	//b3n3_c1
	data_stream<BIT_ACTV*b3n3_c1_NIN> s_b3n3_c1_in("s_b3n3_c1_in");
	expandWidth<BIT_ACTV*b3n2_c3_NACT, BIT_ACTV*b3n3_c1_NIN, HIGHT3*WIDTH3*b3n2_c3_NOCH/b3n2_c3_NACT*N_BATCH>(s_b3n1_b3n2_b1, s_b3n3_c1_in);
	data_stream<BIT_CONV*b3n3_c1_NOUT> s_b3n3_c1_out("s_b3n3_c1_out");
	pwconv_s<b3n3_c1_NIN, b3n3_c1_NOUT, b3n3_c1_NICH, b3n3_c1_NOCH, HIGHT3*WIDTH3*N_BATCH, b3n3_c1_RAM>(s_b3n3_c1_in, s_b3n3_c1_out, b3n3_c1_W);
	data_stream<BIT_CONV*b3n3_c1_NACT> s_b3n3_c1_out_r("s_b3n3_c1_out_r");
	reduceWidth<BIT_CONV*b3n3_c1_NOUT, BIT_CONV*b3n3_c1_NACT, HIGHT3*WIDTH3*N_BATCH*b3n3_c1_NOCH/b3n3_c1_NOUT>(s_b3n3_c1_out, s_b3n3_c1_out_r);
	data_stream<BIT_ACTV*b3n3_c1_NACT> s_b3n3_c1_act("s_b3n3_c1_act");
	norm_relu<b3n3_c1_NACT, b3n3_c1_NOCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n3_c1_out_r, s_b3n3_c1_act, b3n3_c1_B, b3n3_c1_M);

	//b3n3_c2
	data_stream<BIT_ACTV*b3n3_c2_NIO> s_b3n3_c2_in("s_b3n3_c2_in");
	expandWidth<BIT_ACTV*b3n3_c1_NACT, BIT_ACTV*b3n3_c2_NIO, HIGHT3*WIDTH3*b3n3_c1_NOCH/b3n3_c2_NACT*N_BATCH>(s_b3n3_c1_act, s_b3n3_c2_in);
	data_stream<BIT_ACTV*b3n3_c2_NIO> s_b3n3_c2_window("s_b3n3_c2_window");
	stream2window<BIT_ACTV*b3n3_c2_NIO, BIT_ACTV*b3n3_c2_NCH, HIGHT3, WIDTH3, N_BATCH, b3n3_c2_RAM>(s_b3n3_c2_in, s_b3n3_c2_window);
	data_stream<BIT_CONV*b3n3_c2_NIO> s_b3n3_c2_out("s_b3n3_c2_out");
	dwconv_3x3<b3n3_c2_NIO, b3n3_c2_NCH, HIGHT3*WIDTH3*N_BATCH>(s_b3n3_c2_window, s_b3n3_c2_out, b3n3_c2_W);
	data_stream<BIT_CONV*b3n3_c2_NACT> s_b3n3_c2_out_r("s_b3n3_c2_out_r");
	reduceWidth<BIT_CONV*b3n3_c2_NIO, BIT_CONV*b3n3_c2_NACT, HIGHT3*WIDTH3*N_BATCH*b3n3_c2_NCH/b3n3_c2_NIO>(s_b3n3_c2_out, s_b3n3_c2_out_r);
	data_stream<BIT_ACTV*b3n3_c2_NACT> s_b3n3_c2_act("s_b3n3_c2_act");
	norm_relu<b3n3_c2_NACT, b3n3_c2_NCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n3_c2_out_r, s_b3n3_c2_act, b3n3_c2_B, b3n3_c2_M);

	//b3n3_c3
	data_stream<BIT_ACTV*b3n3_c3_NIN> s_b3n3_c3_in("s_b3n3_c3_in");
	expandWidth<BIT_ACTV*b3n3_c2_NACT, BIT_ACTV*b3n3_c3_NIN, HIGHT3*WIDTH3*b3n3_c1_NOCH/b3n3_c2_NACT*N_BATCH>(s_b3n3_c2_act, s_b3n3_c3_in);
	data_stream<BIT_CONV*b3n3_c3_NOUT> s_b3n3_c3_out("s_b3n3_c3_out");
	pwconv_u<b3n3_c3_NIN, b3n3_c3_NOUT, b3n3_c3_NICH, b3n3_c3_NOCH, HIGHT3*WIDTH3*N_BATCH, b3n3_c3_RAM>(s_b3n3_c3_in, s_b3n3_c3_out, b3n3_c3_W);
	data_stream<BIT_CONV*b3n3_c3_NACT> s_b3n3_c3_out_r("s_b3n3_c3_out_r");
	reduceWidth<BIT_CONV*b3n3_c3_NOUT, BIT_CONV*b3n3_c3_NACT, HIGHT3*WIDTH3*N_BATCH*b3n3_c3_NOCH/b3n3_c3_NOUT>(s_b3n3_c3_out, s_b3n3_c3_out_r);
	data_stream<BIT_ACTV*b3n3_c3_NACT> s_b3n3_c3_act("s_b3n3_c3_act");
	norm<b3n3_c3_NACT, b3n3_c3_NOCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b3n3_c3_out_r, s_b3n3_c3_act, b3n3_c3_B, b3n3_c3_M);

	//b3n1 + b3n2 + b3n3
	data_stream<BIT_ACTV*b3n3_c3_NACT> s_b3n1_b3n2_b3n3("s_b3n1_b3n2_b3n3");
	add<b3n3_c3_NACT, b3n3_c3_NOCH, HIGHT3*WIDTH3*N_BATCH>(s_b3n1_b3n2_b2, s_b3n3_c3_act, s_b3n1_b3n2_b3n3);

	//b4n1_c1
	data_stream<BIT_ACTV*b4n1_c1_NIN> s_b4n1_c1_in("s_b4n1_c1_in");
	expandWidth<BIT_ACTV*b3n3_c3_NACT, BIT_ACTV*b4n1_c1_NIN, HIGHT3*WIDTH3*b3n3_c3_NOCH/b3n3_c3_NACT*N_BATCH>(s_b3n1_b3n2_b3n3, s_b4n1_c1_in);
	data_stream<BIT_CONV*b4n1_c1_NOUT> s_b4n1_c1_out("s_b4n1_c1_out");
	pwconv_s<b4n1_c1_NIN, b4n1_c1_NOUT, b4n1_c1_NICH, b4n1_c1_NOCH, HIGHT3*WIDTH3*N_BATCH, b4n1_c1_RAM>(s_b4n1_c1_in, s_b4n1_c1_out, b4n1_c1_W);
	data_stream<BIT_CONV*b4n1_c1_NACT> s_b4n1_c1_out_r("s_b4n1_c1_out_r");
	reduceWidth<BIT_CONV*b4n1_c1_NOUT, BIT_CONV*b4n1_c1_NACT, HIGHT3*WIDTH3*N_BATCH*b4n1_c1_NOCH/b4n1_c1_NOUT>(s_b4n1_c1_out, s_b4n1_c1_out_r);
	data_stream<BIT_ACTV*b4n1_c1_NACT> s_b4n1_c1_act("s_b4n1_c1_act");
	norm_relu<b4n1_c1_NACT, b4n1_c1_NOCH, BIT_MULT-1, HIGHT3*WIDTH3*N_BATCH>(s_b4n1_c1_out_r, s_b4n1_c1_act, b4n1_c1_B, b4n1_c1_M);

	//b4n1_c2
	data_stream<BIT_ACTV*b4n1_c2_NIO> s_b4n1_c2_in("s_b4n1_c2_in");
	expandWidth<BIT_ACTV*b4n1_c1_NACT, BIT_ACTV*b4n1_c2_NIO, HIGHT3*WIDTH3*b4n1_c1_NOCH/b4n1_c1_NACT*N_BATCH>(s_b4n1_c1_act, s_b4n1_c2_in);
	data_stream<BIT_ACTV*b4n1_c2_NIO> s_b4n1_c2_window("s_b4n1_c2_window");
	stream2window<BIT_ACTV*b4n1_c2_NIO, BIT_ACTV*b4n1_c2_NCH, HIGHT3, WIDTH3, N_BATCH, b4n1_c2_RAM, 2>(s_b4n1_c2_in, s_b4n1_c2_window);
	data_stream<BIT_ACTV*b4n1_c2_NIO/b4n1_c2_NG> s_b4n1_c2_window_r("s_b4n1_c2_window_r");
	reduceWidth<
		BIT_ACTV*b4n1_c2_NIO, 
		BIT_ACTV*b4n1_c2_NIO/b4n1_c2_NG, 
		HIGHT4*WIDTH4*b4n1_c1_NOCH/b4n1_c2_NIO*b4n1_c2_K*b4n1_c2_K*N_BATCH>
	(s_b4n1_c2_window, s_b4n1_c2_window_r);
	data_stream<BIT_CONV*b4n1_c2_NIO/b4n1_c2_NG> s_b4n1_c2_out("s_b4n1_c2_out");
	dwconv_3x3_r<b4n1_c2_NIO, b4n1_c2_NCH, b4n1_c2_K, b4n1_c2_NG, HIGHT4*WIDTH4*N_BATCH>(s_b4n1_c2_window_r, s_b4n1_c2_out, b4n1_c2_W);
	data_stream<BIT_CONV*b4n1_c2_NACT> s_b4n1_c2_out_r("s_b4n1_c1_out_r");
	reduceWidth<BIT_CONV*b4n1_c2_NIO/b4n1_c2_NG, BIT_CONV*b4n1_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b4n1_c2_NCH/b4n1_c2_NIO*b4n1_c2_NG>(s_b4n1_c2_out, s_b4n1_c2_out_r);
	data_stream<BIT_ACTV*b4n1_c2_NACT> s_b4n1_c2_act("s_b4n1_c2_act");
	norm_relu<b4n1_c2_NACT, b4n1_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n1_c2_out_r, s_b4n1_c2_act, b4n1_c2_B, b4n1_c2_M);

	//b4n1_c3
	data_stream<BIT_ACTV*b4n1_c3_NIN> s_b4n1_c3_in("s_b4n1_c3_in");
	expandWidth<BIT_ACTV*b4n1_c2_NACT, BIT_ACTV*b4n1_c3_NIN, HIGHT4*WIDTH4*b4n1_c1_NOCH/b4n1_c2_NACT*N_BATCH>(s_b4n1_c2_act, s_b4n1_c3_in);
	data_stream<BIT_CONV*b4n1_c3_NOUT> s_b4n1_c3_out("s_b4n1_c3_out");
	pwconv_u<b4n1_c3_NIN, b4n1_c3_NOUT, b4n1_c3_NICH, b4n1_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n1_c3_RAM>(s_b4n1_c3_in, s_b4n1_c3_out, b4n1_c3_W);
	data_stream<BIT_CONV*b4n1_c3_NACT> s_b4n1_c3_out_r("s_b4n1_c3_out_r");
	reduceWidth<BIT_CONV*b4n1_c3_NOUT, BIT_CONV*b4n1_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b4n1_c3_NOCH/b4n1_c3_NOUT>(s_b4n1_c3_out, s_b4n1_c3_out_r);
	data_stream<BIT_ACTV*b4n1_c3_NACT> s_b4n1_c3_act("s_b4n1_c3_act"), s_b4n1_c3_act_b1("s_b4n1_c3_act_b1"), s_b4n1_c3_act_b2("s_b4n1_c3_act_b2");
	norm<b4n1_c3_NACT, b4n1_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n1_c3_out_r, s_b4n1_c3_act, b4n1_c3_B, b4n1_c3_M);
	copy_stream<BIT_ACTV*b4n1_c3_NACT, HIGHT4*WIDTH4*b4n1_c3_NOCH/b4n1_c3_NACT*N_BATCH>(s_b4n1_c3_act, s_b4n1_c3_act_b1, s_b4n1_c3_act_b2);

	//b4n2_c1
	data_stream<BIT_ACTV*b4n2_c1_NIN> s_b4n2_c1_in("s_b4n2_c1_in");
	expandWidth<BIT_ACTV*b4n1_c3_NACT, BIT_ACTV*b4n2_c1_NIN, HIGHT4*WIDTH4*b4n1_c3_NOCH/b4n1_c3_NACT*N_BATCH>(s_b4n1_c3_act_b1, s_b4n2_c1_in);
	data_stream<BIT_CONV*b4n2_c1_NOUT> s_b4n2_c1_out("s_b4n2_c1_out");
	pwconv_s<b4n2_c1_NIN, b4n2_c1_NOUT, b4n2_c1_NICH, b4n2_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n2_c1_RAM>(s_b4n2_c1_in, s_b4n2_c1_out, b4n2_c1_W);
	data_stream<BIT_CONV*b4n2_c1_NACT> s_b4n2_c1_out_r("s_b4n2_c1_out_r");
	reduceWidth<BIT_CONV*b4n2_c1_NOUT, BIT_CONV*b4n2_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b4n2_c1_NOCH/b4n2_c1_NOUT>(s_b4n2_c1_out, s_b4n2_c1_out_r);
	data_stream<BIT_ACTV*b4n2_c1_NACT> s_b4n2_c1_act("s_b4n2_c1_act");
	norm_relu<b4n2_c1_NACT, b4n2_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n2_c1_out_r, s_b4n2_c1_act, b4n2_c1_B, b4n2_c1_M);

	//b4n2_c2
	data_stream<BIT_ACTV*b4n2_c2_NIO> s_b4n2_c2_in("s_b4n2_c2_in");
	expandWidth<BIT_ACTV*b4n2_c1_NACT, BIT_ACTV*b4n2_c2_NIO, HIGHT4*WIDTH4*b4n2_c1_NOCH/b4n2_c2_NACT*N_BATCH>(s_b4n2_c1_act, s_b4n2_c2_in);
	data_stream<BIT_ACTV*b4n2_c2_NIO> s_b4n2_c2_window("s_b4n2_c2_window");
	stream2window<BIT_ACTV*b4n2_c2_NIO, BIT_ACTV*b4n2_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b4n2_c2_RAM>(s_b4n2_c2_in, s_b4n2_c2_window);
	data_stream<BIT_CONV*b4n2_c2_NIO> s_b4n2_c2_out("s_b4n2_c2_out");
	dwconv_3x3<b4n2_c2_NIO, b4n2_c2_NCH, HIGHT4*WIDTH4*N_BATCH>(s_b4n2_c2_window, s_b4n2_c2_out, b4n2_c2_W);
	data_stream<BIT_CONV*b4n2_c2_NACT> s_b4n2_c2_out_r("s_b4n2_c2_out_r");
	reduceWidth<BIT_CONV*b4n2_c2_NIO, BIT_CONV*b4n2_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b4n2_c2_NCH/b4n2_c2_NIO>(s_b4n2_c2_out, s_b4n2_c2_out_r);
	data_stream<BIT_ACTV*b4n2_c2_NACT> s_b4n2_c2_act("s_b4n2_c2_act");
	norm_relu<b4n2_c2_NACT, b4n2_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n2_c2_out_r, s_b4n2_c2_act, b4n2_c2_B, b4n2_c2_M);

	//b4n2_c3
	data_stream<BIT_ACTV*b4n2_c3_NIN> s_b4n2_c3_in("s_b4n2_c3_in");
	expandWidth<BIT_ACTV*b4n2_c2_NACT, BIT_ACTV*b4n2_c3_NIN, HIGHT4*WIDTH4*b4n2_c1_NOCH/b4n2_c2_NACT*N_BATCH>(s_b4n2_c2_act, s_b4n2_c3_in);
	data_stream<BIT_CONV*b4n2_c3_NOUT> s_b4n2_c3_out("s_b4n2_c3_out");
	pwconv_u<b4n2_c3_NIN, b4n2_c3_NOUT, b4n2_c3_NICH, b4n2_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n2_c3_RAM>(s_b4n2_c3_in, s_b4n2_c3_out, b4n2_c3_W);
	data_stream<BIT_CONV*b4n2_c3_NACT> s_b4n2_c3_out_r("s_b4n2_c3_out_r");
	reduceWidth<BIT_CONV*b4n2_c3_NOUT, BIT_CONV*b4n2_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b4n2_c3_NOCH/b4n2_c3_NOUT>(s_b4n2_c3_out, s_b4n2_c3_out_r);
	data_stream<BIT_ACTV*b4n2_c3_NACT> s_b4n2_c3_act("s_b4n2_c3_act");
	norm<b4n2_c3_NACT, b4n2_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n2_c3_out_r, s_b4n2_c3_act, b4n2_c3_B, b4n2_c3_M);

	//b4n1 + b4n2
	data_stream<BIT_ACTV*b4n2_c3_NACT> s_b4n1_b4n2("s_b4n1_b4n2"), s_b4n1_b4n2_b1("s_b4n1_b4n2_b1"), s_b4n1_b4n2_b2("s_b4n1_b4n2_b2");
	add<b4n2_c3_NACT, b4n2_c3_NOCH, HIGHT4*WIDTH4*N_BATCH>(s_b4n1_c3_act_b2, s_b4n2_c3_act, s_b4n1_b4n2);
	copy_stream<BIT_ACTV*b4n1_c3_NACT, HIGHT4*WIDTH4*b4n1_c3_NOCH/b4n1_c3_NACT*N_BATCH>(s_b4n1_b4n2, s_b4n1_b4n2_b1, s_b4n1_b4n2_b2);

	//b4n3_c1
	data_stream<BIT_ACTV*b4n3_c1_NIN> s_b4n3_c1_in("s_b4n3_c1_in");
	expandWidth<BIT_ACTV*b4n2_c3_NACT, BIT_ACTV*b4n3_c1_NIN, HIGHT4*WIDTH4*b4n2_c3_NOCH/b4n2_c3_NACT*N_BATCH>(s_b4n1_b4n2_b1, s_b4n3_c1_in);
	data_stream<BIT_CONV*b4n3_c1_NOUT> s_b4n3_c1_out("s_b4n3_c1_out");
	pwconv_s<b4n3_c1_NIN, b4n3_c1_NOUT, b4n3_c1_NICH, b4n3_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n3_c1_RAM>(s_b4n3_c1_in, s_b4n3_c1_out, b4n3_c1_W);
	data_stream<BIT_CONV*b4n3_c1_NACT> s_b4n3_c1_out_r("s_b4n3_c1_out_r");
	reduceWidth<BIT_CONV*b4n3_c1_NOUT, BIT_CONV*b4n3_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b4n3_c1_NOCH/b4n3_c1_NOUT>(s_b4n3_c1_out, s_b4n3_c1_out_r);
	data_stream<BIT_ACTV*b4n3_c1_NACT> s_b4n3_c1_act("s_b4n3_c1_act");
	norm_relu<b4n3_c1_NACT, b4n3_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n3_c1_out_r, s_b4n3_c1_act, b4n3_c1_B, b4n3_c1_M);

	//b4n3_c2
	data_stream<BIT_ACTV*b4n3_c2_NIO> s_b4n3_c2_in("s_b4n3_c2_in");
	expandWidth<BIT_ACTV*b4n3_c1_NACT, BIT_ACTV*b4n3_c2_NIO, HIGHT4*WIDTH4*b4n3_c1_NOCH/b4n3_c2_NACT*N_BATCH>(s_b4n3_c1_act, s_b4n3_c2_in);
	data_stream<BIT_ACTV*b4n3_c2_NIO> s_b4n3_c2_window("s_b4n3_c2_window");
	stream2window<BIT_ACTV*b4n3_c2_NIO, BIT_ACTV*b4n3_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b4n3_c2_RAM>(s_b4n3_c2_in, s_b4n3_c2_window);
	data_stream<BIT_CONV*b4n3_c2_NIO> s_b4n3_c2_out("s_b4n3_c2_out");
	dwconv_3x3<b4n3_c2_NIO, b4n3_c2_NCH, HIGHT4*WIDTH4*N_BATCH>(s_b4n3_c2_window, s_b4n3_c2_out, b4n3_c2_W);
	data_stream<BIT_CONV*b4n3_c2_NACT> s_b4n3_c2_out_r("s_b4n3_c2_out_r");
	reduceWidth<BIT_CONV*b4n3_c2_NIO, BIT_CONV*b4n3_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b4n3_c2_NCH/b4n3_c2_NIO>(s_b4n3_c2_out, s_b4n3_c2_out_r);
	data_stream<BIT_ACTV*b4n3_c2_NACT> s_b4n3_c2_act("s_b4n3_c2_act");
	norm_relu<b4n3_c2_NACT, b4n3_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n3_c2_out_r, s_b4n3_c2_act, b4n3_c2_B, b4n3_c2_M);

	//b4n3_c3
	data_stream<BIT_ACTV*b4n3_c3_NIN> s_b4n3_c3_in("s_b4n3_c3_in");
	expandWidth<BIT_ACTV*b4n3_c2_NACT, BIT_ACTV*b4n3_c3_NIN, HIGHT4*WIDTH4*b4n3_c1_NOCH/b4n3_c2_NACT*N_BATCH>(s_b4n3_c2_act, s_b4n3_c3_in);
	data_stream<BIT_CONV*b4n3_c3_NOUT> s_b4n3_c3_out("s_b4n3_c3_out");
	pwconv_u<b4n3_c3_NIN, b4n3_c3_NOUT, b4n3_c3_NICH, b4n3_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n3_c3_RAM>(s_b4n3_c3_in, s_b4n3_c3_out, b4n3_c3_W);
	data_stream<BIT_CONV*b4n3_c3_NACT> s_b4n3_c3_out_r("s_b4n3_c3_out_r");
	reduceWidth<BIT_CONV*b4n3_c3_NOUT, BIT_CONV*b4n3_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b4n3_c3_NOCH/b4n3_c3_NOUT>(s_b4n3_c3_out, s_b4n3_c3_out_r);
	data_stream<BIT_ACTV*b4n3_c3_NACT> s_b4n3_c3_act("s_b4n3_c3_act");
	norm<b4n3_c3_NACT, b4n3_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n3_c3_out_r, s_b4n3_c3_act, b4n3_c3_B, b4n3_c3_M);

	//b4n1 + b4n2 + b4n3
	data_stream<BIT_ACTV*b4n3_c3_NACT> s_b4n1_b4n2_b4n3("s_b4n1_b4n2_b4n3"), s_b4n1_b4n2_b4n3_b1("s_b4n1_b4n2_b4n3_b1"), s_b4n1_b4n2_b4n3_b2("s_b4n1_b4n2_b4n3_b2");
	add<b4n3_c3_NACT, b4n3_c3_NOCH, HIGHT4*WIDTH4*N_BATCH>(s_b4n1_b4n2_b2, s_b4n3_c3_act, s_b4n1_b4n2_b4n3);
	copy_stream<BIT_ACTV*b4n3_c3_NACT, HIGHT4*WIDTH4*b4n3_c3_NOCH/b4n3_c3_NACT*N_BATCH>(s_b4n1_b4n2_b4n3, s_b4n1_b4n2_b4n3_b1, s_b4n1_b4n2_b4n3_b2);

	//b4n4_c1
	data_stream<BIT_ACTV*b4n4_c1_NIN> s_b4n4_c1_in("s_b4n4_c1_in");
	expandWidth<BIT_ACTV*b4n2_c3_NACT, BIT_ACTV*b4n4_c1_NIN, HIGHT4*WIDTH4*b4n2_c3_NOCH/b4n2_c3_NACT*N_BATCH>(s_b4n1_b4n2_b4n3_b1, s_b4n4_c1_in);
	data_stream<BIT_CONV*b4n4_c1_NOUT> s_b4n4_c1_out("s_b4n4_c1_out");
	pwconv_s<b4n4_c1_NIN, b4n4_c1_NOUT, b4n4_c1_NICH, b4n4_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n4_c1_RAM>(s_b4n4_c1_in, s_b4n4_c1_out, b4n4_c1_W);
	data_stream<BIT_CONV*b4n4_c1_NACT> s_b4n4_c1_out_r("s_b4n4_c1_out_r");
	reduceWidth<BIT_CONV*b4n4_c1_NOUT, BIT_CONV*b4n4_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b4n4_c1_NOCH/b4n4_c1_NOUT>(s_b4n4_c1_out, s_b4n4_c1_out_r);
	data_stream<BIT_ACTV*b4n4_c1_NACT> s_b4n4_c1_act("s_b4n4_c1_act");
	norm_relu<b4n4_c1_NACT, b4n4_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n4_c1_out_r, s_b4n4_c1_act, b4n4_c1_B, b4n4_c1_M);

	//b4n4_c2
	data_stream<BIT_ACTV*b4n4_c2_NIO> s_b4n4_c2_in("s_b4n4_c2_in");
	expandWidth<BIT_ACTV*b4n4_c1_NACT, BIT_ACTV*b4n4_c2_NIO, HIGHT4*WIDTH4*b4n4_c1_NOCH/b4n4_c2_NACT*N_BATCH>(s_b4n4_c1_act, s_b4n4_c2_in);
	data_stream<BIT_ACTV*b4n4_c2_NIO> s_b4n4_c2_window("s_b4n4_c2_window");
	stream2window<BIT_ACTV*b4n4_c2_NIO, BIT_ACTV*b4n4_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b4n4_c2_RAM>(s_b4n4_c2_in, s_b4n4_c2_window);
	data_stream<BIT_CONV*b4n4_c2_NIO> s_b4n4_c2_out("s_b4n4_c2_out");
	dwconv_3x3<b4n4_c2_NIO, b4n4_c2_NCH, HIGHT4*WIDTH4*N_BATCH>(s_b4n4_c2_window, s_b4n4_c2_out, b4n4_c2_W);
	data_stream<BIT_CONV*b4n4_c2_NACT> s_b4n4_c2_out_r("s_b4n4_c2_out_r");
	reduceWidth<BIT_CONV*b4n4_c2_NIO, BIT_CONV*b4n4_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b4n4_c2_NCH/b4n4_c2_NIO>(s_b4n4_c2_out, s_b4n4_c2_out_r);
	data_stream<BIT_ACTV*b4n4_c2_NACT> s_b4n4_c2_act("s_b4n4_c2_act");
	norm_relu<b4n4_c2_NACT, b4n4_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n4_c2_out_r, s_b4n4_c2_act, b4n4_c2_B, b4n4_c2_M);

	//b4n4_c3
	data_stream<BIT_ACTV*b4n4_c3_NIN> s_b4n4_c3_in("s_b4n4_c3_in");
	expandWidth<BIT_ACTV*b4n4_c2_NACT, BIT_ACTV*b4n4_c3_NIN, HIGHT4*WIDTH4*b4n4_c1_NOCH/b4n4_c2_NACT*N_BATCH>(s_b4n4_c2_act, s_b4n4_c3_in);
	data_stream<BIT_CONV*b4n4_c3_NOUT> s_b4n4_c3_out("s_b4n4_c3_out");
	pwconv_u<b4n4_c3_NIN, b4n4_c3_NOUT, b4n4_c3_NICH, b4n4_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b4n3_c3_RAM>(s_b4n4_c3_in, s_b4n4_c3_out, b4n4_c3_W);
	data_stream<BIT_CONV*b4n4_c3_NACT> s_b4n4_c3_out_r("s_b4n4_c3_out_r");
	reduceWidth<BIT_CONV*b4n4_c3_NOUT, BIT_CONV*b4n4_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b4n4_c3_NOCH/b4n4_c3_NOUT>(s_b4n4_c3_out, s_b4n4_c3_out_r);
	data_stream<BIT_ACTV*b4n4_c3_NACT> s_b4n4_c3_act("s_b4n4_c3_act");
	norm<b4n4_c3_NACT, b4n4_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b4n4_c3_out_r, s_b4n4_c3_act, b4n4_c3_B, b4n4_c3_M);

	//b4n1 + b4n2 + b4n3 + b4n4
	data_stream<BIT_ACTV*b4n4_c3_NACT> s_b4n1_b4n2_b4n3_b4n4("s_b4n1_b4n2_b4n3_b4n4");
	add<b4n4_c3_NACT, b4n4_c3_NOCH, HIGHT4*WIDTH4*N_BATCH>(s_b4n1_b4n2_b4n3_b2, s_b4n4_c3_act, s_b4n1_b4n2_b4n3_b4n4);

	//b5n1_c1
	data_stream<BIT_ACTV*b5n1_c1_NIN> s_b5n1_c1_in("s_b5n1_c1_in");
	expandWidth<BIT_ACTV*b4n4_c3_NACT, BIT_ACTV*b5n1_c1_NIN, HIGHT4*WIDTH4*b4n4_c3_NOCH/b4n4_c3_NACT*N_BATCH>(s_b4n1_b4n2_b4n3_b4n4, s_b5n1_c1_in);
	data_stream<BIT_CONV*b5n1_c1_NOUT> s_b5n1_c1_out("s_b5n1_c1_out");
	pwconv_s<b5n1_c1_NIN, b5n1_c1_NOUT, b5n1_c1_NICH, b5n1_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b5n1_c1_RAM>(s_b5n1_c1_in, s_b5n1_c1_out, b5n1_c1_W);
	data_stream<BIT_CONV*b5n1_c1_NACT> s_b5n1_c1_out_r("s_b5n1_c1_out_r");
	reduceWidth<BIT_CONV*b5n1_c1_NOUT, BIT_CONV*b5n1_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b5n1_c1_NOCH/b5n1_c1_NOUT>(s_b5n1_c1_out, s_b5n1_c1_out_r);
	data_stream<BIT_ACTV*b5n1_c1_NACT> s_b5n1_c1_act("s_b5n1_c1_act");
	norm_relu<b5n1_c1_NACT, b5n1_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n1_c1_out_r, s_b5n1_c1_act, b5n1_c1_B, b5n1_c1_M);

	//b5n1_c2
	data_stream<BIT_ACTV*b5n1_c2_NIO> s_b5n1_c2_in("s_b5n1_c2_in");
	expandWidth<BIT_ACTV*b5n1_c1_NACT, BIT_ACTV*b5n1_c2_NIO, HIGHT4*WIDTH4*b5n1_c1_NOCH/b5n1_c1_NACT*N_BATCH>(s_b5n1_c1_act, s_b5n1_c2_in);
	data_stream<BIT_ACTV*b5n1_c2_NIO> s_b5n1_c2_window("s_b5n1_c2_window");
	stream2window<BIT_ACTV*b5n1_c2_NIO, BIT_ACTV*b5n1_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b5n1_c2_RAM>(s_b5n1_c2_in, s_b5n1_c2_window);
	data_stream<BIT_CONV*b5n1_c2_NIO> s_b5n1_c2_out("s_b5n1_c2_out");
	dwconv_3x3<b5n1_c2_NIO, b5n1_c2_NCH, HIGHT4*WIDTH4*N_BATCH>(s_b5n1_c2_window, s_b5n1_c2_out, b5n1_c2_W);
	data_stream<BIT_CONV*b5n1_c2_NACT> s_b5n1_c2_out_r("s_b5n1_c1_out_r");
	reduceWidth<BIT_CONV*b5n1_c2_NIO, BIT_CONV*b5n1_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b5n1_c2_NCH/b5n1_c2_NIO>(s_b5n1_c2_out, s_b5n1_c2_out_r);
	data_stream<BIT_ACTV*b5n1_c2_NACT> s_b5n1_c2_act("s_b5n1_c2_act");
	norm_relu<b5n1_c2_NACT, b5n1_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n1_c2_out_r, s_b5n1_c2_act, b5n1_c2_B, b5n1_c2_M);

	//b5n1_c3
	data_stream<BIT_ACTV*b5n1_c3_NIN> s_b5n1_c3_in("s_b5n1_c3_in");
	expandWidth<BIT_ACTV*b5n1_c2_NACT, BIT_ACTV*b5n1_c3_NIN, HIGHT4*WIDTH4*b5n1_c1_NOCH/b5n1_c2_NACT*N_BATCH>(s_b5n1_c2_act, s_b5n1_c3_in);
	data_stream<BIT_CONV*b5n1_c3_NOUT> s_b5n1_c3_out("s_b5n1_c3_out");
	pwconv_u<b5n1_c3_NIN, b5n1_c3_NOUT, b5n1_c3_NICH, b5n1_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b5n1_c3_RAM>(s_b5n1_c3_in, s_b5n1_c3_out, b5n1_c3_W);
	data_stream<BIT_CONV*b5n1_c3_NACT> s_b5n1_c3_out_r("s_b5n1_c3_out_r");
	reduceWidth<BIT_CONV*b5n1_c3_NOUT, BIT_CONV*b5n1_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b5n1_c3_NOCH/b5n1_c3_NOUT>(s_b5n1_c3_out, s_b5n1_c3_out_r);
	data_stream<BIT_ACTV*b5n1_c3_NACT> s_b5n1_c3_act("s_b5n1_c3_act"), s_b5n1_c3_act_b1("s_b5n1_c3_act_b1"), s_b5n1_c3_act_b2("s_b5n1_c3_act_b2");
	norm<b5n1_c3_NACT, b5n1_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n1_c3_out_r, s_b5n1_c3_act, b5n1_c3_B, b5n1_c3_M);
	copy_stream<BIT_ACTV*b5n1_c3_NACT, HIGHT4*WIDTH4*b5n1_c3_NOCH/b5n1_c3_NACT*N_BATCH>(s_b5n1_c3_act, s_b5n1_c3_act_b1, s_b5n1_c3_act_b2);

	//b5n2_c1
	data_stream<BIT_ACTV*b5n2_c1_NIN> s_b5n2_c1_in("s_b5n2_c1_in");
	expandWidth<BIT_ACTV*b5n1_c3_NACT, BIT_ACTV*b5n2_c1_NIN, HIGHT4*WIDTH4*b5n1_c3_NOCH/b5n1_c3_NACT*N_BATCH>(s_b5n1_c3_act_b1, s_b5n2_c1_in);
	data_stream<BIT_CONV*b5n2_c1_NOUT> s_b5n2_c1_out("s_b5n2_c1_out");
	pwconv_s<b5n2_c1_NIN, b5n2_c1_NOUT, b5n2_c1_NICH, b5n2_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b5n2_c1_RAM>(s_b5n2_c1_in, s_b5n2_c1_out, b5n2_c1_W);
	data_stream<BIT_CONV*b5n2_c1_NACT> s_b5n2_c1_out_r("s_b5n2_c1_out_r");
	reduceWidth<BIT_CONV*b5n2_c1_NOUT, BIT_CONV*b5n2_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b5n2_c1_NOCH/b5n2_c1_NOUT>(s_b5n2_c1_out, s_b5n2_c1_out_r);
	data_stream<BIT_ACTV*b5n2_c1_NACT> s_b5n2_c1_act("s_b5n2_c1_act");
	norm_relu<b5n2_c1_NACT, b5n2_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n2_c1_out_r, s_b5n2_c1_act, b5n2_c1_B, b5n2_c1_M);

	//b5n2_c2
	data_stream<BIT_ACTV*b5n2_c2_NIO> s_b5n2_c2_in("s_b5n2_c2_in");
	expandWidth<BIT_ACTV*b5n2_c1_NACT, BIT_ACTV*b5n2_c2_NIO, HIGHT4*WIDTH4*b5n2_c1_NOCH/b5n2_c2_NACT*N_BATCH>(s_b5n2_c1_act, s_b5n2_c2_in);
	data_stream<BIT_ACTV*b5n2_c2_NIO> s_b5n2_c2_window("s_b5n2_c2_window");
	stream2window<BIT_ACTV*b5n2_c2_NIO, BIT_ACTV*b5n2_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b5n2_c2_RAM>(s_b5n2_c2_in, s_b5n2_c2_window);
	data_stream<BIT_CONV*b5n2_c2_NIO> s_b5n2_c2_out("s_b5n2_c2_out");
	dwconv_3x3<b5n2_c2_NIO, b5n2_c2_NCH, HIGHT4*WIDTH4*N_BATCH>(s_b5n2_c2_window, s_b5n2_c2_out, b5n2_c2_W);
	data_stream<BIT_CONV*b5n2_c2_NACT> s_b5n2_c2_out_r("s_b5n2_c2_out_r");
	reduceWidth<BIT_CONV*b5n2_c2_NIO, BIT_CONV*b5n2_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b5n2_c2_NCH/b5n2_c2_NIO>(s_b5n2_c2_out, s_b5n2_c2_out_r);
	data_stream<BIT_ACTV*b5n2_c2_NACT> s_b5n2_c2_act("s_b5n2_c2_act");
	norm_relu<b5n2_c2_NACT, b5n2_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n2_c2_out_r, s_b5n2_c2_act, b5n2_c2_B, b5n2_c2_M);

	//b5n2_c3
	data_stream<BIT_ACTV*b5n2_c3_NIN> s_b5n2_c3_in("s_b5n2_c3_in");
	expandWidth<BIT_ACTV*b5n2_c2_NACT, BIT_ACTV*b5n2_c3_NIN, HIGHT4*WIDTH4*b5n2_c1_NOCH/b5n2_c2_NACT*N_BATCH>(s_b5n2_c2_act, s_b5n2_c3_in);
	data_stream<BIT_CONV*b5n2_c3_NOUT> s_b5n2_c3_out("s_b5n2_c3_out");
	pwconv_u<b5n2_c3_NIN, b5n2_c3_NOUT, b5n2_c3_NICH, b5n2_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b5n2_c3_RAM>(s_b5n2_c3_in, s_b5n2_c3_out, b5n2_c3_W);
	data_stream<BIT_CONV*b5n2_c3_NACT> s_b5n2_c3_out_r("s_b5n2_c3_out_r");
	reduceWidth<BIT_CONV*b5n2_c3_NOUT, BIT_CONV*b5n2_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b5n2_c3_NOCH/b5n2_c3_NOUT>(s_b5n2_c3_out, s_b5n2_c3_out_r);
	data_stream<BIT_ACTV*b5n2_c3_NACT> s_b5n2_c3_act("s_b5n2_c3_act");
	norm<b5n2_c3_NACT, b5n2_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n2_c3_out_r, s_b5n2_c3_act, b5n2_c3_B, b5n2_c3_M);

	//b5n1 + b5n2
	data_stream<BIT_ACTV*b5n2_c3_NACT> s_b5n1_b5n2("s_b5n1_b5n2"), s_b5n1_b5n2_b1("s_b5n1_b5n2_b1"), s_b5n1_b5n2_b2("s_b5n1_b5n2_b2");
	add<b5n2_c3_NACT, b5n2_c3_NOCH, HIGHT4*WIDTH4*N_BATCH>(s_b5n1_c3_act_b2, s_b5n2_c3_act, s_b5n1_b5n2);
	copy_stream<BIT_ACTV*b5n1_c3_NACT, HIGHT4*WIDTH4*b5n1_c3_NOCH/b5n1_c3_NACT*N_BATCH>(s_b5n1_b5n2, s_b5n1_b5n2_b1, s_b5n1_b5n2_b2);

	//b5n3_c1
	data_stream<BIT_ACTV*b5n3_c1_NIN> s_b5n3_c1_in("s_b5n3_c1_in");
	expandWidth<BIT_ACTV*b5n2_c3_NACT, BIT_ACTV*b5n3_c1_NIN, HIGHT4*WIDTH4*b5n2_c3_NOCH/b5n2_c3_NACT*N_BATCH>(s_b5n1_b5n2_b1, s_b5n3_c1_in);
	data_stream<BIT_CONV*b5n3_c1_NOUT> s_b5n3_c1_out("s_b5n3_c1_out");
	pwconv_s<b5n3_c1_NIN, b5n3_c1_NOUT, b5n3_c1_NICH, b5n3_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b5n3_c1_RAM>(s_b5n3_c1_in, s_b5n3_c1_out, b5n3_c1_W);
	data_stream<BIT_CONV*b5n3_c1_NACT> s_b5n3_c1_out_r("s_b5n3_c1_out_r");
	reduceWidth<BIT_CONV*b5n3_c1_NOUT, BIT_CONV*b5n3_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b5n3_c1_NOCH/b5n3_c1_NOUT>(s_b5n3_c1_out, s_b5n3_c1_out_r);
	data_stream<BIT_ACTV*b5n3_c1_NACT> s_b5n3_c1_act("s_b5n3_c1_act");
	norm_relu<b5n3_c1_NACT, b5n3_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n3_c1_out_r, s_b5n3_c1_act, b5n3_c1_B, b5n3_c1_M);

	//b5n3_c2
	data_stream<BIT_ACTV*b5n3_c2_NIO> s_b5n3_c2_in("s_b5n3_c2_in");
	expandWidth<BIT_ACTV*b5n3_c1_NACT, BIT_ACTV*b5n3_c2_NIO, HIGHT4*WIDTH4*b5n3_c1_NOCH/b5n3_c2_NACT*N_BATCH>(s_b5n3_c1_act, s_b5n3_c2_in);
	data_stream<BIT_ACTV*b5n3_c2_NIO> s_b5n3_c2_window("s_b5n3_c2_window");
	stream2window<BIT_ACTV*b5n3_c2_NIO, BIT_ACTV*b5n3_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b5n3_c2_RAM>(s_b5n3_c2_in, s_b5n3_c2_window);
	data_stream<BIT_CONV*b5n3_c2_NIO> s_b5n3_c2_out("s_b5n3_c2_out");
	dwconv_3x3<b5n3_c2_NIO, b5n3_c2_NCH, HIGHT4*WIDTH4*N_BATCH>(s_b5n3_c2_window, s_b5n3_c2_out, b5n3_c2_W);
	data_stream<BIT_CONV*b5n3_c2_NACT> s_b5n3_c2_out_r("s_b5n3_c2_out_r");
	reduceWidth<BIT_CONV*b5n3_c2_NIO, BIT_CONV*b5n3_c2_NACT, HIGHT4*WIDTH4*N_BATCH*b5n3_c2_NCH/b5n3_c2_NIO>(s_b5n3_c2_out, s_b5n3_c2_out_r);
	data_stream<BIT_ACTV*b5n3_c2_NACT> s_b5n3_c2_act("s_b5n3_c2_act");
	norm_relu<b5n3_c2_NACT, b5n3_c2_NCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n3_c2_out_r, s_b5n3_c2_act, b5n3_c2_B, b5n3_c2_M);

	//b5n3_c3
	data_stream<BIT_ACTV*b5n3_c3_NIN> s_b5n3_c3_in("s_b5n3_c3_in");
	expandWidth<BIT_ACTV*b5n3_c2_NACT, BIT_ACTV*b5n3_c3_NIN, HIGHT4*WIDTH4*b5n3_c1_NOCH/b5n3_c2_NACT*N_BATCH>(s_b5n3_c2_act, s_b5n3_c3_in);
	data_stream<BIT_CONV*b5n3_c3_NOUT> s_b5n3_c3_out("s_b5n3_c3_out");
	pwconv_u<b5n3_c3_NIN, b5n3_c3_NOUT, b5n3_c3_NICH, b5n3_c3_NOCH, HIGHT4*WIDTH4*N_BATCH, b5n3_c3_RAM>(s_b5n3_c3_in, s_b5n3_c3_out, b5n3_c3_W);
	data_stream<BIT_CONV*b5n3_c3_NACT> s_b5n3_c3_out_r("s_b5n3_c3_out_r");
	reduceWidth<BIT_CONV*b5n3_c3_NOUT, BIT_CONV*b5n3_c3_NACT, HIGHT4*WIDTH4*N_BATCH*b5n3_c3_NOCH/b5n3_c3_NOUT>(s_b5n3_c3_out, s_b5n3_c3_out_r);
	data_stream<BIT_ACTV*b5n3_c3_NACT> s_b5n3_c3_act("s_b5n3_c3_act");
	norm<b5n3_c3_NACT, b5n3_c3_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b5n3_c3_out_r, s_b5n3_c3_act, b5n3_c3_B, b5n3_c3_M);

	//b5n1 + b5n2 + b5n3
	data_stream<BIT_ACTV*b5n3_c3_NACT> s_b5n1_b5n2_b5n3("s_b5n1_b5n2_b5n3");
	add<b5n3_c3_NACT, b5n3_c3_NOCH, HIGHT4*WIDTH4*N_BATCH>(s_b5n1_b5n2_b2, s_b5n3_c3_act, s_b5n1_b5n2_b5n3);

	//b6n1_c1
	data_stream<BIT_ACTV*b6n1_c1_NIN> s_b6n1_c1_in("s_b6n1_c1_in");
	expandWidth<BIT_ACTV*b5n3_c3_NACT, BIT_ACTV*b6n1_c1_NIN, HIGHT4*WIDTH4*b5n3_c3_NOCH/b5n3_c3_NACT*N_BATCH>(s_b5n1_b5n2_b5n3, s_b6n1_c1_in);
	data_stream<BIT_CONV*b6n1_c1_NOUT> s_b6n1_c1_out("s_b6n1_c1_out");
	pwconv_s<b6n1_c1_NIN, b6n1_c1_NOUT, b6n1_c1_NICH, b6n1_c1_NOCH, HIGHT4*WIDTH4*N_BATCH, b6n1_c1_RAM>(s_b6n1_c1_in, s_b6n1_c1_out, b6n1_c1_W);
	data_stream<BIT_CONV*b6n1_c1_NACT> s_b6n1_c1_out_r("s_b6n1_c1_out_r");
	reduceWidth<BIT_CONV*b6n1_c1_NOUT, BIT_CONV*b6n1_c1_NACT, HIGHT4*WIDTH4*N_BATCH*b6n1_c1_NOCH/b6n1_c1_NOUT>(s_b6n1_c1_out, s_b6n1_c1_out_r);
	data_stream<BIT_ACTV*b6n1_c1_NACT> s_b6n1_c1_act("s_b6n1_c1_act");
	norm_relu<b6n1_c1_NACT, b6n1_c1_NOCH, BIT_MULT-1, HIGHT4*WIDTH4*N_BATCH>(s_b6n1_c1_out_r, s_b6n1_c1_act, b6n1_c1_B, b6n1_c1_M);

	//b6n1_c2
	data_stream<BIT_ACTV*b6n1_c2_NIO> s_b6n1_c2_in("s_b6n1_c2_in");
	expandWidth<BIT_ACTV*b6n1_c1_NACT, BIT_ACTV*b6n1_c2_NIO, HIGHT4*WIDTH4*b6n1_c1_NOCH/b6n1_c1_NACT*N_BATCH>(s_b6n1_c1_act, s_b6n1_c2_in);
	data_stream<BIT_ACTV*b6n1_c2_NIO> s_b6n1_c2_window("s_b6n1_c2_window");
	stream2window<BIT_ACTV*b6n1_c2_NIO, BIT_ACTV*b6n1_c2_NCH, HIGHT4, WIDTH4, N_BATCH, b6n1_c2_RAM, 2>(s_b6n1_c2_in, s_b6n1_c2_window);
	data_stream<BIT_ACTV*b6n1_c2_NIO/b6n1_c2_NG> s_b6n1_c2_window_r("s_b6n1_c2_window_r");
	reduceWidth<
		BIT_ACTV*b6n1_c2_NIO, 
		BIT_ACTV*b6n1_c2_NIO/b6n1_c2_NG, 
		HIGHT5*WIDTH5*b6n1_c1_NOCH/b6n1_c2_NIO*b6n1_c2_K*b6n1_c2_K*N_BATCH>
	(s_b6n1_c2_window, s_b6n1_c2_window_r);
	data_stream<BIT_CONV*b6n1_c2_NIO/b6n1_c2_NG> s_b6n1_c2_out("s_b6n1_c2_out");
	dwconv_3x3_r<b6n1_c2_NIO, b6n1_c2_NCH, b6n1_c2_K, b6n1_c2_NG, HIGHT5*WIDTH5*N_BATCH>(s_b6n1_c2_window_r, s_b6n1_c2_out, b6n1_c2_W);
	data_stream<BIT_CONV*b6n1_c2_NACT> s_b6n1_c2_out_r("s_b6n1_c1_out_r");
	reduceWidth<BIT_CONV*b6n1_c2_NIO/b6n1_c2_NG, BIT_CONV*b6n1_c2_NACT, HIGHT5*WIDTH5*N_BATCH*b6n1_c2_NCH/b6n1_c2_NIO*b6n1_c2_NG>(s_b6n1_c2_out, s_b6n1_c2_out_r);
	data_stream<BIT_ACTV*b6n1_c2_NACT> s_b6n1_c2_act("s_b6n1_c2_act");
	norm_relu<b6n1_c2_NACT, b6n1_c2_NCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n1_c2_out_r, s_b6n1_c2_act, b6n1_c2_B, b6n1_c2_M);


	//b6n1_c3
	data_stream<BIT_ACTV*b6n1_c3_NIN> s_b6n1_c3_in("s_b6n1_c3_in");
	expandWidth<BIT_ACTV*b6n1_c2_NACT, BIT_ACTV*b6n1_c3_NIN, HIGHT5*WIDTH5*b6n1_c1_NOCH/b6n1_c2_NACT*N_BATCH>(s_b6n1_c2_act, s_b6n1_c3_in);
	data_stream<BIT_CONV*b6n1_c3_NOUT> s_b6n1_c3_out("s_b6n1_c3_out");
	pwconv_u<b6n1_c3_NIN, b6n1_c3_NOUT, b6n1_c3_NICH, b6n1_c3_NOCH, HIGHT5*WIDTH5*N_BATCH, b6n1_c3_RAM>(s_b6n1_c3_in, s_b6n1_c3_out, b6n1_c3_W);
	data_stream<BIT_CONV*b6n1_c3_NACT> s_b6n1_c3_out_r("s_b6n1_c3_out_r");
	reduceWidth<BIT_CONV*b6n1_c3_NOUT, BIT_CONV*b6n1_c3_NACT, HIGHT5*WIDTH5*N_BATCH*b6n1_c3_NOCH/b6n1_c3_NOUT>(s_b6n1_c3_out, s_b6n1_c3_out_r);
	data_stream<BIT_ACTV*b6n1_c3_NACT> s_b6n1_c3_act("s_b6n1_c3_act"), s_b6n1_c3_act_b1("s_b6n1_c3_act_b1"), s_b6n1_c3_act_b2("s_b6n1_c3_act_b2");
	norm<b6n1_c3_NACT, b6n1_c3_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n1_c3_out_r, s_b6n1_c3_act, b6n1_c3_B, b6n1_c3_M);
	copy_stream<BIT_ACTV*b6n1_c3_NACT, HIGHT5*WIDTH5*b6n1_c3_NOCH/b6n1_c3_NACT*N_BATCH>(s_b6n1_c3_act, s_b6n1_c3_act_b1, s_b6n1_c3_act_b2);

	//b6n2_c1
	data_stream<BIT_ACTV*b6n2_c1_NIN> s_b6n2_c1_in("s_b6n2_c1_in");
	expandWidth<BIT_ACTV*b6n1_c3_NACT, BIT_ACTV*b6n2_c1_NIN, HIGHT5*WIDTH5*b6n1_c3_NOCH/b6n1_c3_NACT*N_BATCH>(s_b6n1_c3_act_b1, s_b6n2_c1_in);
	data_stream<BIT_CONV*b6n2_c1_NOUT> s_b6n2_c1_out("s_b6n2_c1_out");
	pwconv_s<b6n2_c1_NIN, b6n2_c1_NOUT, b6n2_c1_NICH, b6n2_c1_NOCH, HIGHT5*WIDTH5*N_BATCH, b6n2_c1_RAM>(s_b6n2_c1_in, s_b6n2_c1_out, b6n2_c1_W);
	data_stream<BIT_CONV*b6n2_c1_NACT> s_b6n2_c1_out_r("s_b6n2_c1_out_r");
	reduceWidth<BIT_CONV*b6n2_c1_NOUT, BIT_CONV*b6n2_c1_NACT, HIGHT5*WIDTH5*N_BATCH*b6n2_c1_NOCH/b6n2_c1_NOUT>(s_b6n2_c1_out, s_b6n2_c1_out_r);
	data_stream<BIT_ACTV*b6n2_c1_NACT> s_b6n2_c1_act("s_b6n2_c1_act");
	norm_relu<b6n2_c1_NACT, b6n2_c1_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n2_c1_out_r, s_b6n2_c1_act, b6n2_c1_B, b6n2_c1_M);

	//b6n2_c2
	data_stream<BIT_ACTV*b6n2_c2_NIO> s_b6n2_c2_in("s_b6n2_c2_in");
	expandWidth<BIT_ACTV*b6n2_c1_NACT, BIT_ACTV*b6n2_c2_NIO, HIGHT5*WIDTH5*b6n2_c1_NOCH/b6n2_c2_NACT*N_BATCH>(s_b6n2_c1_act, s_b6n2_c2_in);
	data_stream<BIT_ACTV*b6n2_c2_NIO> s_b6n2_c2_window("s_b6n2_c2_window");
	stream2window<BIT_ACTV*b6n2_c2_NIO, BIT_ACTV*b6n2_c2_NCH, HIGHT5, WIDTH5, N_BATCH, b6n2_c2_RAM>(s_b6n2_c2_in, s_b6n2_c2_window);
	data_stream<BIT_CONV*b6n2_c2_NIO> s_b6n2_c2_out("s_b6n2_c2_out");
	dwconv_3x3<b6n2_c2_NIO, b6n2_c2_NCH, HIGHT5*WIDTH5*N_BATCH>(s_b6n2_c2_window, s_b6n2_c2_out, b6n2_c2_W);
	data_stream<BIT_CONV*b6n2_c2_NACT> s_b6n2_c2_out_r("s_b6n2_c2_out_r");
	reduceWidth<BIT_CONV*b6n2_c2_NIO, BIT_CONV*b6n2_c2_NACT, HIGHT5*WIDTH5*N_BATCH*b6n2_c2_NCH/b6n2_c2_NIO>(s_b6n2_c2_out, s_b6n2_c2_out_r);
	data_stream<BIT_ACTV*b6n2_c2_NACT> s_b6n2_c2_act("s_b6n2_c2_act");
	norm_relu<b6n2_c2_NACT, b6n2_c2_NCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n2_c2_out_r, s_b6n2_c2_act, b6n2_c2_B, b6n2_c2_M);

	//b6n2_c3
	data_stream<BIT_ACTV*b6n2_c3_NIN> s_b6n2_c3_in("s_b6n2_c3_in");
	expandWidth<BIT_ACTV*b6n2_c2_NACT, BIT_ACTV*b6n2_c3_NIN, HIGHT5*WIDTH5*b6n2_c1_NOCH/b6n2_c2_NACT*N_BATCH>(s_b6n2_c2_act, s_b6n2_c3_in);
	data_stream<BIT_CONV*b6n2_c3_NOUT> s_b6n2_c3_out("s_b6n2_c3_out");
	pwconv_u<b6n2_c3_NIN, b6n2_c3_NOUT, b6n2_c3_NICH, b6n2_c3_NOCH, HIGHT5*WIDTH5*N_BATCH, b6n2_c3_RAM>(s_b6n2_c3_in, s_b6n2_c3_out, b6n2_c3_W);
	data_stream<BIT_CONV*b6n2_c3_NACT> s_b6n2_c3_out_r("s_b6n2_c3_out_r");
	reduceWidth<BIT_CONV*b6n2_c3_NOUT, BIT_CONV*b6n2_c3_NACT, HIGHT5*WIDTH5*N_BATCH*b6n2_c3_NOCH/b6n2_c3_NOUT>(s_b6n2_c3_out, s_b6n2_c3_out_r);
	data_stream<BIT_ACTV*b6n2_c3_NACT> s_b6n2_c3_act("s_b6n2_c3_act");
	norm<b6n2_c3_NACT, b6n2_c3_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n2_c3_out_r, s_b6n2_c3_act, b6n2_c3_B, b6n2_c3_M);

	//b6n1 + b6n2
	data_stream<BIT_ACTV*b6n2_c3_NACT> s_b6n1_b6n2("s_b6n1_b6n2"), s_b6n1_b6n2_b1("s_b6n1_b6n2_b1"), s_b6n1_b6n2_b2("s_b6n1_b6n2_b2");
	add<b6n2_c3_NACT, b6n2_c3_NOCH, HIGHT5*WIDTH5*N_BATCH>(s_b6n1_c3_act_b2, s_b6n2_c3_act, s_b6n1_b6n2);
	copy_stream<BIT_ACTV*b6n1_c3_NACT, HIGHT5*WIDTH5*b6n1_c3_NOCH/b6n1_c3_NACT*N_BATCH>(s_b6n1_b6n2, s_b6n1_b6n2_b1, s_b6n1_b6n2_b2);

	//b6n3_c1
	data_stream<BIT_ACTV*b6n3_c1_NIN> s_b6n3_c1_in("s_b6n3_c1_in");
	expandWidth<BIT_ACTV*b6n2_c3_NACT, BIT_ACTV*b6n3_c1_NIN, HIGHT5*WIDTH5*b6n2_c3_NOCH/b6n2_c3_NACT*N_BATCH>(s_b6n1_b6n2_b1, s_b6n3_c1_in);
	data_stream<BIT_CONV*b6n3_c1_NOUT> s_b6n3_c1_out("s_b6n3_c1_out");
	pwconv_s<b6n3_c1_NIN, b6n3_c1_NOUT, b6n3_c1_NICH, b6n3_c1_NOCH, HIGHT5*WIDTH5*N_BATCH, b6n3_c3_RAM>(s_b6n3_c1_in, s_b6n3_c1_out, b6n3_c1_W);
	data_stream<BIT_CONV*b6n3_c1_NACT> s_b6n3_c1_out_r("s_b6n3_c1_out_r");
	reduceWidth<BIT_CONV*b6n3_c1_NOUT, BIT_CONV*b6n3_c1_NACT, HIGHT5*WIDTH5*N_BATCH*b6n3_c1_NOCH/b6n3_c1_NOUT>(s_b6n3_c1_out, s_b6n3_c1_out_r);
	data_stream<BIT_ACTV*b6n3_c1_NACT> s_b6n3_c1_act("s_b6n3_c1_act");
	norm_relu<b6n3_c1_NACT, b6n3_c1_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n3_c1_out_r, s_b6n3_c1_act, b6n3_c1_B, b6n3_c1_M);

	//b6n3_c2
	data_stream<BIT_ACTV*b6n3_c2_NIO> s_b6n3_c2_in("s_b6n3_c2_in");
	expandWidth<BIT_ACTV*b6n3_c1_NACT, BIT_ACTV*b6n3_c2_NIO, HIGHT5*WIDTH5*b6n3_c1_NOCH/b6n3_c2_NACT*N_BATCH>(s_b6n3_c1_act, s_b6n3_c2_in);
	data_stream<BIT_ACTV*b6n3_c2_NIO> s_b6n3_c2_window("s_b6n3_c2_window");
	stream2window<BIT_ACTV*b6n3_c2_NIO, BIT_ACTV*b6n3_c2_NCH, HIGHT5, WIDTH5, N_BATCH, b6n3_c2_RAM>(s_b6n3_c2_in, s_b6n3_c2_window);
	data_stream<BIT_CONV*b6n3_c2_NIO> s_b6n3_c2_out("s_b6n3_c2_out");
	dwconv_3x3<b6n3_c2_NIO, b6n3_c2_NCH, HIGHT5*WIDTH5*N_BATCH>(s_b6n3_c2_window, s_b6n3_c2_out, b6n3_c2_W);
	data_stream<BIT_CONV*b6n3_c2_NACT> s_b6n3_c2_out_r("s_b6n3_c2_out_r");
	reduceWidth<BIT_CONV*b6n3_c2_NIO, BIT_CONV*b6n3_c2_NACT, HIGHT5*WIDTH5*N_BATCH*b6n3_c2_NCH/b6n3_c2_NIO>(s_b6n3_c2_out, s_b6n3_c2_out_r);
	data_stream<BIT_ACTV*b6n3_c2_NACT> s_b6n3_c2_act("s_b6n3_c2_act");
	norm_relu<b6n3_c2_NACT, b6n3_c2_NCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n3_c2_out_r, s_b6n3_c2_act, b6n3_c2_B, b6n3_c2_M);

	//b6n3_c3
	data_stream<BIT_ACTV*b6n3_c3_NIN> s_b6n3_c3_in("s_b6n3_c3_in");
	expandWidth<BIT_ACTV*b6n3_c2_NACT, BIT_ACTV*b6n3_c3_NIN, HIGHT5*WIDTH5*b6n3_c1_NOCH/b6n3_c2_NACT*N_BATCH>(s_b6n3_c2_act, s_b6n3_c3_in);
	data_stream<BIT_CONV*b6n3_c3_NOUT> s_b6n3_c3_out("s_b6n3_c3_out");
	pwconv_u<b6n3_c3_NIN, b6n3_c3_NOUT, b6n3_c3_NICH, b6n3_c3_NOCH, HIGHT5*WIDTH5*N_BATCH, b6n3_c3_RAM>(s_b6n3_c3_in, s_b6n3_c3_out, b6n3_c3_W);
	data_stream<BIT_CONV*b6n3_c3_NACT> s_b6n3_c3_out_r("s_b6n3_c3_out_r");
	reduceWidth<BIT_CONV*b6n3_c3_NOUT, BIT_CONV*b6n3_c3_NACT, HIGHT5*WIDTH5*N_BATCH*b6n3_c3_NOCH/b6n3_c3_NOUT>(s_b6n3_c3_out, s_b6n3_c3_out_r);
	data_stream<BIT_ACTV*b6n3_c3_NACT> s_b6n3_c3_act("s_b6n3_c3_act");
	norm<b6n3_c3_NACT, b6n3_c3_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b6n3_c3_out_r, s_b6n3_c3_act, b6n3_c3_B, b6n3_c3_M);

	//b6n1 + b6n2 + b6n3
	data_stream<BIT_ACTV*b6n3_c3_NACT> s_b6n1_b6n2_b6n3("s_b6n1_b6n2_b6n3");
	add<b6n3_c3_NACT, b6n3_c3_NOCH, HIGHT5*WIDTH5*N_BATCH>(s_b6n1_b6n2_b2, s_b6n3_c3_act, s_b6n1_b6n2_b6n3);

	//b7n1_c1
	data_stream<BIT_ACTV*b7n1_c1_NIN> s_b7n1_c1_in("s_b7n1_c1_in");
	expandWidth<BIT_ACTV*b6n3_c3_NACT, BIT_ACTV*b7n1_c1_NIN, HIGHT5*WIDTH5*b6n3_c3_NOCH/b6n3_c3_NACT*N_BATCH>(s_b6n1_b6n2_b6n3, s_b7n1_c1_in);
	data_stream<BIT_CONV*b7n1_c1_NOUT> s_b7n1_c1_out("s_b7n1_c1_out");
	pwconv_s<b7n1_c1_NIN, b7n1_c1_NOUT, b7n1_c1_NICH, b7n1_c1_NOCH, HIGHT5*WIDTH5*N_BATCH, b7n1_c1_RAM>(s_b7n1_c1_in, s_b7n1_c1_out, b7n1_c1_W);
	data_stream<BIT_CONV*b7n1_c1_NACT> s_b7n1_c1_out_r("s_b7n1_c1_out_r");
	reduceWidth<BIT_CONV*b7n1_c1_NOUT, BIT_CONV*b7n1_c1_NACT, HIGHT5*WIDTH5*N_BATCH*b7n1_c1_NOCH/b7n1_c1_NOUT>(s_b7n1_c1_out, s_b7n1_c1_out_r);
	data_stream<BIT_ACTV*b7n1_c1_NACT> s_b7n1_c1_act("s_b7n1_c1_act");
	norm_relu<b7n1_c1_NACT, b7n1_c1_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b7n1_c1_out_r, s_b7n1_c1_act, b7n1_c1_B, b7n1_c1_M);

	//b7n1_c2
	data_stream<BIT_ACTV*b7n1_c2_NIO> s_b7n1_c2_in("s_b7n1_c2_in");
	expandWidth<BIT_ACTV*b7n1_c1_NACT, BIT_ACTV*b7n1_c2_NIO, HIGHT5*WIDTH5*b7n1_c1_NOCH/b7n1_c1_NACT*N_BATCH>(s_b7n1_c1_act, s_b7n1_c2_in);
	data_stream<BIT_ACTV*b7n1_c2_NIO> s_b7n1_c2_window("s_b7n1_c2_window");
	stream2window<BIT_ACTV*b7n1_c2_NIO, BIT_ACTV*b7n1_c2_NCH, HIGHT5, WIDTH5, N_BATCH, b7n1_c2_RAM>(s_b7n1_c2_in, s_b7n1_c2_window);
	data_stream<BIT_CONV*b7n1_c2_NIO> s_b7n1_c2_out("s_b7n1_c2_out");
	dwconv_3x3<b7n1_c2_NIO, b7n1_c2_NCH, HIGHT5*WIDTH5*N_BATCH>(s_b7n1_c2_window, s_b7n1_c2_out, b7n1_c2_W);
	data_stream<BIT_CONV*b7n1_c2_NACT> s_b7n1_c2_out_r("s_b7n1_c1_out_r");
	reduceWidth<BIT_CONV*b7n1_c2_NIO, BIT_CONV*b7n1_c2_NACT, HIGHT5*WIDTH5*N_BATCH*b7n1_c2_NCH/b7n1_c2_NIO>(s_b7n1_c2_out, s_b7n1_c2_out_r);
	data_stream<BIT_ACTV*b7n1_c2_NACT> s_b7n1_c2_act("s_b7n1_c2_act");
	norm_relu<b7n1_c2_NACT, b7n1_c2_NCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b7n1_c2_out_r, s_b7n1_c2_act, b7n1_c2_B, b7n1_c2_M);

	//b7n1_c3
	data_stream<BIT_ACTV*b7n1_c3_NIN> s_b7n1_c3_in("s_b7n1_c3_in");
	expandWidth<BIT_ACTV*b7n1_c2_NACT, BIT_ACTV*b7n1_c3_NIN, HIGHT5*WIDTH5*b7n1_c1_NOCH/b7n1_c2_NACT*N_BATCH>(s_b7n1_c2_act, s_b7n1_c3_in);
	data_stream<BIT_CONV*b7n1_c3_NOUT> s_b7n1_c3_out("s_b7n1_c3_out");
	pwconv_u<b7n1_c3_NIN, b7n1_c3_NOUT, b7n1_c3_NICH, b7n1_c3_NOCH, HIGHT5*WIDTH5*N_BATCH, b7n1_c3_RAM>(s_b7n1_c3_in, s_b7n1_c3_out, b7n1_c3_W);
	data_stream<BIT_CONV*b7n1_c3_NACT> s_b7n1_c3_out_r("s_b7n1_c3_out_r");
	reduceWidth<BIT_CONV*b7n1_c3_NOUT, BIT_CONV*b7n1_c3_NACT, HIGHT5*WIDTH5*N_BATCH*b7n1_c3_NOCH/b7n1_c3_NOUT>(s_b7n1_c3_out, s_b7n1_c3_out_r);
	data_stream<BIT_ACTV*b7n1_c3_NACT> s_b7n1_c3_act("s_b7n1_c3_act");
	norm<b7n1_c3_NACT, b7n1_c3_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_b7n1_c3_out_r, s_b7n1_c3_act, b7n1_c3_B, b7n1_c3_M);

	//conv8
	data_stream<BIT_ACTV*conv8_NIN> s_conv8_in("s_conv8_in");
	expandWidth<BIT_ACTV*b7n1_c3_NACT, BIT_ACTV*conv8_NIN, HIGHT5*WIDTH5*b7n1_c3_NOCH/b7n1_c3_NACT*N_BATCH>(s_b7n1_c3_act, s_conv8_in);
	data_stream<BIT_CONV*conv8_NOUT> s_conv8_out("s_conv8_out");
	pwconv_s<conv8_NIN, conv8_NOUT, conv8_NICH, conv8_NOCH, HIGHT5*WIDTH5*N_BATCH, conv8_RAM>(s_conv8_in, s_conv8_out, conv8_W);
	data_stream<BIT_CONV*conv8_NACT> s_conv8_out_r("s_conv8_out_r");
	reduceWidth<BIT_CONV*conv8_NOUT, BIT_CONV*conv8_NACT, HIGHT5*WIDTH5*N_BATCH*conv8_NOCH/conv8_NOUT>(s_conv8_out, s_conv8_out_r);
	data_stream<BIT_ACTV*conv8_NACT> s_conv8_act("s_conv8_act");
	norm_relu<conv8_NACT, conv8_NOCH, BIT_MULT-1, HIGHT5*WIDTH5*N_BATCH>(s_conv8_out_r, s_conv8_act, conv8_B, conv8_M);

	data_stream<BIT_CONV*conv8_NACT> s_avgpool("s_avgpool");
	avgpool<conv8_NACT, conv8_NOCH, HIGHT5, WIDTH5, N_BATCH>(s_conv8_act, s_avgpool);

	data_stream<BIT_CONV> s_output("s_output");
	reduceWidth<BIT_CONV*conv8_NACT, BIT_CONV, conv8_NOCH/conv8_NACT*N_BATCH>(s_avgpool, s_output);

	add_last<BIT_CONV, BIT_IO, conv8_NOCH*N_BATCH>(s_output, out);
}
*/